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_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"); }
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"); }