Exemple #1
0
        public void TestValidEmailMultiple()
        {
            ValidEmailMultiple emailSettings = new ValidEmailMultiple();
            ValidEmailMultiple validEmail    = ValidateSettings <ValidEmailMultiple> .Validate(emailSettings);

            Assert.IsTrue(validEmail.Email == "[email protected];[email protected]");
        }
Exemple #2
0
        public void TestValidEmailSingle()
        {
            ValidEmail emailSettings = new ValidEmail();
            ValidEmail validEmail    = ValidateSettings <ValidEmail> .Validate(emailSettings);

            Assert.IsTrue(validEmail.Email == "*****@*****.**");
        }
Exemple #3
0
        public void ValidDefault()
        {
            DefaultTestString test = new DefaultTestString();

            test = ValidateSettings <DefaultTestString> .Validate(test);

            Assert.AreEqual(test.Value, "hello");
        }
Exemple #4
0
        public void ValidateDefaultIntWithRange()
        {
            DefaultIntZeroWithinRange test = new DefaultIntZeroWithinRange();

            test = ValidateSettings <DefaultIntZeroWithinRange> .Validate(test);

            Assert.AreEqual(0, test.Value);
        }
Exemple #5
0
        public void TestValidOptional1()
        {
            ValidEmail emailSettings = new ValidEmail();

            emailSettings = ValidateSettings <ValidEmail> .Validate(emailSettings);

            Assert.IsTrue(String.IsNullOrEmpty(emailSettings.Email));
        }
Exemple #6
0
        public void ValidDefaultAppPath()
        {
            DefaultTestStringAppPath test = new DefaultTestStringAppPath();

            test = ValidateSettings <DefaultTestStringAppPath> .Validate(test);

            Assert.IsTrue(test.Value.EndsWith("AppSettings\\Test\\bin\\Debug\\net5.0"));
        }
Exemple #7
0
        public void ValidDefaultSpecialFolder()
        {
            DefaultTestStringSpecialFolder test = new DefaultTestStringSpecialFolder();

            test = ValidateSettings <DefaultTestStringSpecialFolder> .Validate(test);

            Assert.AreEqual(test.Value, "C:\\Users\\Public\\Music");
        }
Exemple #8
0
        public void RegexValidTest()
        {
            RegexTest test = new RegexTest()
            {
                Example = "Abbnn9@M8"
            };

            test = ValidateSettings <RegexTest> .Validate(test);
        }
Exemple #9
0
        public void RangeIntInvalid()
        {
            RangeInt range = new RangeInt()
            {
                Value = 0
            };

            range = ValidateSettings <RangeInt> .Validate(range);
        }
Exemple #10
0
        public void InvalidResponse1()
        {
            ResponseServerError response = new ResponseServerError
            {
                ResponseCode = 404
            };

            response = ValidateSettings <ResponseServerError> .Validate(response);
        }
Exemple #11
0
        public void InvalidDelimitedString()
        {
            DelimitedInvalid delimited = new DelimitedInvalid()
            {
                Test = "one;two;three;four;five;six;seven"
            };

            delimited = ValidateSettings <DelimitedInvalid> .Validate(delimited);
        }
Exemple #12
0
        public void ValidDelimitedStringTooMany()
        {
            Delimited delimited = new Delimited()
            {
                Test = "one#two#three#four#five#six#seven"
            };

            delimited = ValidateSettings <Delimited> .Validate(delimited);
        }
Exemple #13
0
        public void InvalidResponse3()
        {
            ResponseServerCustom response = new ResponseServerCustom
            {
                ResponseCode = 502
            };

            response = ValidateSettings <ResponseServerCustom> .Validate(response);
        }
Exemple #14
0
        public void PathInvalid()
        {
            PathExistValid pathExist = new PathExistValid()
            {
                Path = "C:\\wintwirk"
            };

            pathExist = ValidateSettings <PathExistValid> .Validate(pathExist);
        }
Exemple #15
0
        public void ValidUriEndpoint()
        {
            UriEndpointTest test = new UriEndpointTest()
            {
                Value = "http://www.google.com"
            };

            test = ValidateSettings <UriEndpointTest> .Validate(test);
        }
Exemple #16
0
        public void InvalidUri()
        {
            UriTest test = new UriTest()
            {
                Value = "not a / uri.com"
            };

            test = ValidateSettings <UriTest> .Validate(test);
        }
Exemple #17
0
        public void ValidStringLength()
        {
            StringTestNotNullLength test = new StringTestNotNullLength()
            {
                Value = "testing"
            };

            test = ValidateSettings <StringTestNotNullLength> .Validate(test);
        }
Exemple #18
0
        public void NullStringInvalid()
        {
            StringTestNotNull test = new StringTestNotNull()
            {
                Value = null
            };

            test = ValidateSettings <StringTestNotNull> .Validate(test);
        }
Exemple #19
0
        public void ValidResponse4()
        {
            ResponseServerError response = new ResponseServerError
            {
                ResponseCode = 500
            };

            response = ValidateSettings <ResponseServerError> .Validate(response);
        }
Exemple #20
0
        public void ValidResponse3()
        {
            ResponseClientError response = new ResponseClientError
            {
                ResponseCode = 404
            };

            response = ValidateSettings <ResponseClientError> .Validate(response);
        }
Exemple #21
0
        public void ValidResponse8()
        {
            ResponseServerCustom response = new ResponseServerCustom
            {
                ResponseCode = 999
            };

            response = ValidateSettings <ResponseServerCustom> .Validate(response);
        }
Exemple #22
0
        public void RegexInvalidTest()
        {
            RegexTest test = new RegexTest()
            {
                Example = "asdfsadfasdfbbnn9@m8"
            };

            test = ValidateSettings <RegexTest> .Validate(test);
        }
Exemple #23
0
        public void PathValidTrue()
        {
            PathExistValid pathExistValid = new PathExistValid()
            {
                Path = "C:\\windows"
            };

            pathExistValid = ValidateSettings <PathExistValid> .Validate(pathExistValid);
        }
Exemple #24
0
        public void ValidDelimitedStringTooFew()
        {
            Delimited delimited = new Delimited()
            {
                Test = "one"
            };

            delimited = ValidateSettings <Delimited> .Validate(delimited);
        }
        public void InvalidNVP2()
        {
            NameValuePairInvalid nameValuePair = new NameValuePairInvalid()
            {
                Setting = "one=two;two=three;three=four"
            };

            nameValuePair = ValidateSettings <NameValuePairInvalid> .Validate(nameValuePair);
        }
Exemple #26
0
        public void InvalidResponse2()
        {
            ResponseClientError response = new ResponseClientError
            {
                ResponseCode = 200
            };

            response = ValidateSettings <ResponseClientError> .Validate(response);
        }
Exemple #27
0
        public void ValidPartialUri()
        {
            UriRelativeTest test = new UriRelativeTest()
            {
                Value = "/Help"
            };

            test = ValidateSettings <UriRelativeTest> .Validate(test);
        }
Exemple #28
0
        public void TestInvalidOptional1()
        {
            ValidEmail emailSettings = new ValidEmail()
            {
                Email = "mehere.com"
            };

            emailSettings = ValidateSettings <ValidEmail> .Validate(emailSettings);
        }
Exemple #29
0
        public void InvalidUriEndpoint()
        {
            UriEndpointTest test = new UriEndpointTest()
            {
                Value = "http://www.thereshouldbenodomainhere.com"
            };

            test = ValidateSettings <UriEndpointTest> .Validate(test);
        }
Exemple #30
0
        public void ValidDelimitedString()
        {
            Delimited delimited = new Delimited()
            {
                Test = "one#two#three"
            };

            delimited = ValidateSettings <Delimited> .Validate(delimited);
        }