public void Email_Address_Variations_All_Match()
        {
            var emailSelector = new EmailSelector();
            var emailTestClass = new EmailTestClass();

            //Iterate over all of the properties in the EmailTestClass object...
            foreach (var property in emailTestClass.GetType().GetProperties())
            {
                var emailSelectorResult = emailSelector.CanBind(property);
                Assert.IsTrue(emailSelectorResult, string.Format("{0} should have been a valid match", property.Name));
            }
        }
Пример #2
0
        public void Email_Address_Variations_All_Match()
        {
            var emailSelector  = new EmailSelector();
            var emailTestClass = new EmailTestClass();

            //Iterate over all of the properties in the EmailTestClass object...
            foreach (var property in emailTestClass.GetType().GetProperties())
            {
                var emailSelectorResult = emailSelector.CanBind(property);
                Assert.IsTrue(emailSelectorResult, string.Format("{0} should have been a valid match", property.Name));
            }
        }
        public void Email_Address_Variations_All_Injected()
        {
            var emailSelector = new EmailSelector();
            var emailTestClass = new EmailTestClass();

            //Iterate over all of the properties in the fullNameClass object...
            foreach (var property in emailTestClass.GetType().GetProperties())
            {
                //Inject the value into the property
                emailSelector.Generate(emailTestClass, property);
            }

            //Iterate over all of the properties again
            foreach (var property in emailTestClass.GetType().GetProperties())
            {
                var fieldValue = property.GetValue(emailTestClass, null) as string;

                Assert.IsNotNullOrEmpty(fieldValue);
                Assert.IsAssignableFrom<string>(fieldValue, "Should be type of string...");
                Assert.That(fieldValue.Length > 0);
            }
        }
Пример #4
0
        public void Email_Address_Variations_All_Injected()
        {
            var emailSelector  = new EmailSelector();
            var emailTestClass = new EmailTestClass();

            //Iterate over all of the properties in the fullNameClass object...
            foreach (var property in emailTestClass.GetType().GetProperties())
            {
                //Inject the value into the property
                emailSelector.Generate(emailTestClass, property);
            }

            //Iterate over all of the properties again
            foreach (var property in emailTestClass.GetType().GetProperties())
            {
                var fieldValue = property.GetValue(emailTestClass, null) as string;

                Assert.IsNotNullOrEmpty(fieldValue);
                Assert.IsAssignableFrom <string>(fieldValue, "Should be type of string...");
                Assert.That(fieldValue.Length > 0);
            }
        }