Esempio n. 1
0
        public void Full_Name_Variations_All_Match()
        {
            var nameSelector  = new FullNameSelector();
            var fullNameClass = new FullNameTestClass();

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

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

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

                Assert.IsNotNullOrEmpty(fieldValue);
                Assert.IsAssignableFrom <string>(fieldValue, "Should be type of string...");
                Assert.That(fieldValue.Length > 0);
            }
        }
        public void Full_Name_Variations_All_Injected()
        {
            var nameSelector = new FullNameSelector();
            var fullNameClass = new FullNameTestClass();

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

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

                Assert.IsNotNullOrEmpty(fieldValue);
                Assert.IsAssignableFrom<string>(fieldValue, "Should be type of string...");
                Assert.That(fieldValue.Length > 0);
            }
        }
        public void Full_Name_Variations_All_Match()
        {
            var nameSelector = new FullNameSelector();
            var fullNameClass = new FullNameTestClass();

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