예제 #1
0
        public void AddRequired_with_duplicate_key_should_fail()
        {
            var key        = "custom";
            var value      = "custom";
            var parameters = new Parameters();

            parameters.AddRequired(key, value);

            Action act = () => parameters.AddRequired(key, value);

            act.Should().Throw <InvalidOperationException>().And.Message.Should().Be($"Duplicate parameter: {key}");
        }
예제 #2
0
        public void AddRequired_with_empty_value_with_allowing_empty_should_be_added()
        {
            var key        = "custom";
            var value      = "";
            var parameters = new Parameters();

            parameters.AddRequired(key, value, allowEmptyValue: true);
            parameters.Should().HaveCount(1);
        }
예제 #3
0
        public void AddRequired_with_empty_value_should_fail()
        {
            var key        = "custom";
            var value      = "";
            var parameters = new Parameters();

            Action act = () => parameters.AddRequired(key, value);

            act.Should().Throw <ArgumentException>().And.ParamName.Should().Be(key);
        }