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);
            }
        }
Example #2
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);
            }
        }