<commit_before>﻿using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
using ExplicitlyImpl.FluentActions.Test.UnitTests.Controllers;
using System;
using Xunit;

namespace ExplicitlyImpl.FluentActions.Test.UnitTests
{
    public class BuilderTestsWithQueryStringParameters
    {
        [Fact(DisplayName = "1 query string parameter (string), returns string")]
        public void FluentControllerBuilder_FluentActionUsingQueryStringParmeterReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name")
                    .To(name => $"Hello {name}!"),
                typeof(ControllerWithQueryStringParameterReturnsString),
                new object[] { "Charlie" });
        }

        [Fact(DisplayName = "1 query string parameter (string) with used default value, returns string")]
        public void FluentControllerBuilder_FluentActionUsingQueryStringParmeterWithUsedDefaultValueReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name", "Hanzel")
                    .To(name => $"Hello {name}!"),
                typeof(ControllerWithQueryStringParameterAndDefaultValueReturnsString),
                new object[] { Type.Missing });
        }

        [Fact(DisplayName = "1 query string parameter (string) with unused default value, returns string")]
        public void FluentControllerBuilder_FluentActionUsingQueryStringParmeterWithUnusedDefaultValueReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name", "Hanzel")
                    .To(name => $"Hello {name}!"),
                typeof(ControllerWithQueryStringParameterAndDefaultValueReturnsString),
                new object[] { "Charlie" });
        }

        [Fact(DisplayName = "2 query string parameters (string, identical), returns string")]
        public void FluentControllerBuilder_FluentActionUsingTwoIdenticalQueryStringParmetersReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name")
                    .UsingQueryStringParameter<string>("name")
                    .To((name1, name2) => $"Hello {name1}! I said hello {name2}!"),
                typeof(ControllerWithTwoIdenticalQueryStringParametersReturnsString),
                new object[] { "Charlie" });
        }
    }
}
<commit_msg>Fixes typo 'Parmeter'<commit_after>﻿using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
using ExplicitlyImpl.FluentActions.Test.UnitTests.Controllers;
using System;
using Xunit;

namespace ExplicitlyImpl.FluentActions.Test.UnitTests
{
    public class BuilderTestsWithQueryStringParameters
    {
        [Fact(DisplayName = "1 query string parameter (string), returns string")]
        public void FluentControllerBuilder_FluentActionUsingQueryStringParmeterReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name")
                    .To(name => $"Hello {name}!"),
                typeof(ControllerWithQueryStringParameterReturnsString),
                new object[] { "Charlie" });
        }

        [Fact(DisplayName = "1 query string parameter (string) with used default value, returns string")]
        public void FluentControllerBuilder_FluentActionUsingQueryStringParameterWithUsedDefaultValueReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name", "Hanzel")
                    .To(name => $"Hello {name}!"),
                typeof(ControllerWithQueryStringParameterAndDefaultValueReturnsString),
                new object[] { Type.Missing });
        }

        [Fact(DisplayName = "1 query string parameter (string) with unused default value, returns string")]
        public void FluentControllerBuilder_FluentActionUsingQueryStringParameterWithUnusedDefaultValueReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name", "Hanzel")
                    .To(name => $"Hello {name}!"),
                typeof(ControllerWithQueryStringParameterAndDefaultValueReturnsString),
                new object[] { "Charlie" });
        }

        [Fact(DisplayName = "2 query string parameters (string, identical), returns string")]
        public void FluentControllerBuilder_FluentActionUsingTwoIdenticalQueryStringParmetersReturnsString()
        {
            BuilderTestUtils.BuildActionAndCompareToStaticAction(
                new FluentAction("/route/url", HttpMethod.Get)
                    .UsingQueryStringParameter<string>("name")
                    .UsingQueryStringParameter<string>("name")
                    .To((name1, name2) => $"Hello {name1}! I said hello {name2}!"),
                typeof(ControllerWithTwoIdenticalQueryStringParametersReturnsString),
                new object[] { "Charlie" });
        }
    }
}

{'fraction_non_alphanumeric': 0.09155429382540808, 'fraction_numerical': 0.0028388928317956, 'mean_word_length': 2.750499001996008, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '684284', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1336, 'n_words': 246}