public void Test_Construct_ShouldConstruct()
        {
            //---------------Set up test pack-------------------
            
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IViewBuilder viewBuilder = new DefaultViewBuilder<FakeBoOnePropOneSingleRelationship>();
            //---------------Test Result -----------------------
            Assert.IsNotNull(viewBuilder);
        }
Example #2
0
        public void Test_Construct_ShouldConstruct()
        {
            //---------------Set up test pack-------------------

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IViewBuilder viewBuilder = new DefaultViewBuilder <FakeBoOnePropOneSingleRelationship>();

            //---------------Test Result -----------------------
            Assert.IsNotNull(viewBuilder);
        }
 public void Test_GetGridView_ShouldNotAddBusinessObjectPropsmarkedWithTypeDescriptorIgnoreAttribute()
 {
     //---------------Set up test pack-------------------
     IViewBuilder viewBuilder = new DefaultViewBuilder<FakeBoOnePropOneSingleRelationship>();
     //---------------Assert Precondition----------------
     Assert.IsTrue(ClassDef.ClassDefs.Contains(typeof(FakeBoOnePropOneSingleRelationship)));
     //---------------Execute Test ----------------------
     PropertyDescriptorCollection descriptorCollection = viewBuilder.GetPropertyDescriptors();
     //---------------Test Result -----------------------
     Assert.IsNotNull(descriptorCollection);
     Assert.AreEqual(2, descriptorCollection.Count, "Prop, Single Rel");
 }
Example #4
0
        public void Test_GetGridView_ShouldNotAddBusinessObjectPropsmarkedWithTypeDescriptorIgnoreAttribute()
        {
            //---------------Set up test pack-------------------
            IViewBuilder viewBuilder = new DefaultViewBuilder <FakeBoOnePropOneSingleRelationship>();

            //---------------Assert Precondition----------------
            Assert.IsTrue(ClassDef.ClassDefs.Contains(typeof(FakeBoOnePropOneSingleRelationship)));
            //---------------Execute Test ----------------------
            PropertyDescriptorCollection descriptorCollection = viewBuilder.GetPropertyDescriptors();

            //---------------Test Result -----------------------
            Assert.IsNotNull(descriptorCollection);
            Assert.AreEqual(2, descriptorCollection.Count, "Prop, Single Rel");
        }
 public void Test_GetGridView_WithTwoHabiProps_TwoReflectiveProps_ShouldReturnPropDescColWithAllProps()
 {
     //---------------Set up test pack-------------------
     IViewBuilder viewBuilder = new DefaultViewBuilder<FakeBOW2Props>();
     //---------------Assert Precondition----------------
     Assert.IsTrue(ClassDef.ClassDefs.Contains(typeof(FakeBOW2Props)));
     //---------------Execute Test ----------------------
     var descriptorCollection = viewBuilder.GetPropertyDescriptors();
     //---------------Test Result -----------------------
     Assert.AreEqual(4, descriptorCollection.Count);
     descriptorCollection.Cast<PropertyDescriptor>().ShouldContain(prop => prop.Name == "Prop1");
     descriptorCollection.Cast<PropertyDescriptor>().ShouldContain(prop => prop.Name == "Prop2");
     descriptorCollection.Cast<PropertyDescriptor>().ShouldContain(prop => prop.Name == "ReflectiveProp");
     descriptorCollection.Cast<PropertyDescriptor>().ShouldContain(prop => prop.Name == "FakeObjectNotABo");
 }
Example #6
0
        public void Test_GetGridView_WithTwoHabiProps_TwoReflectiveProps_ShouldReturnPropDescColWithAllProps()
        {
            //---------------Set up test pack-------------------
            IViewBuilder viewBuilder = new DefaultViewBuilder <FakeBOW2Props>();

            //---------------Assert Precondition----------------
            Assert.IsTrue(ClassDef.ClassDefs.Contains(typeof(FakeBOW2Props)));
            //---------------Execute Test ----------------------
            var descriptorCollection = viewBuilder.GetPropertyDescriptors();

            //---------------Test Result -----------------------
            Assert.AreEqual(4, descriptorCollection.Count);
            descriptorCollection.Cast <PropertyDescriptor>().ShouldContain(prop => prop.Name == "Prop1");
            descriptorCollection.Cast <PropertyDescriptor>().ShouldContain(prop => prop.Name == "Prop2");
            descriptorCollection.Cast <PropertyDescriptor>().ShouldContain(prop => prop.Name == "ReflectiveProp");
            descriptorCollection.Cast <PropertyDescriptor>().ShouldContain(prop => prop.Name == "FakeObjectNotABo");
        }