Exemplo n.º 1
0
        public void Last_Name_Variations_All_Match()
        {
            var nameSelector      = new LastNameSelector();
            var lastNameTestClass = new LastNameTestClass();

            //Iterate over all of the properties in the fullNameClass object...
            foreach (var property in lastNameTestClass.GetType().GetProperties())
            {
                var nameSelectorResult = nameSelector.CanBind(property);
                Assert.IsTrue(nameSelectorResult, string.Format("{0} should have been a valid match", property.Name));
            }
        }
Exemplo n.º 2
0
        public void Last_Name_Variations_All_Injected()
        {
            var nameSelector      = new LastNameSelector();
            var lastNameTestClass = new LastNameTestClass();

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

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

                Assert.IsNotNullOrEmpty(fieldValue);
                Assert.IsAssignableFrom <string>(fieldValue, "Should be type of string...");
                Assert.That(fieldValue.Length > 0);
            }
        }
        public void Last_Name_Variations_All_Match()
        {
            var nameSelector = new LastNameSelector();
            var lastNameTestClass = new LastNameTestClass();

            //Iterate over all of the properties in the fullNameClass object...
            foreach (var property in lastNameTestClass.GetType().GetProperties())
            {
                var nameSelectorResult = nameSelector.CanBind(property);
                Assert.IsTrue(nameSelectorResult, string.Format("{0} should have been a valid match", property.Name));
            }
        }
        public void Last_Name_Variations_All_Injected()
        {
            var nameSelector = new LastNameSelector();
            var lastNameTestClass = new LastNameTestClass();

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

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

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