Beispiel #1
0
        public void Test_GetFormField_NoPropReturnsNull()
        {
            //---------------Set up test pack-------------------
            UIDefStub uiDef = new UIDefStub();
            uiDef.SetUIForm(GetUiForm());
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IUIFormField formField = uiDef.GetFormField("propDoesNotExist");
            //---------------Test Result -----------------------
            Assert.AreEqual(null, formField);
        }
Beispiel #2
0
        public void Test_GetFormField()
        {
            //---------------Set up test pack-------------------
            UIDefStub uiDef = new UIDefStub();
            uiDef.SetUIForm(GetUiForm());
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IUIFormField formField = uiDef.GetFormField("prop1");
            //---------------Test Result -----------------------
            Assert.AreEqual("prop1", formField.PropertyName);
        }
Beispiel #3
0
        public void Test_GetFormField_NoPropReturnsNull()
        {
            //---------------Set up test pack-------------------
            UIDefStub uiDef = new UIDefStub();

            uiDef.SetUIForm(GetUiForm());
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IUIFormField formField = uiDef.GetFormField("propDoesNotExist");

            //---------------Test Result -----------------------
            Assert.AreEqual(null, formField);
        }
Beispiel #4
0
        public void Test_GetFormField()
        {
            //---------------Set up test pack-------------------
            UIDefStub uiDef = new UIDefStub();

            uiDef.SetUIForm(GetUiForm());
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IUIFormField formField = uiDef.GetFormField("prop1");

            //---------------Test Result -----------------------
            Assert.AreEqual("prop1", formField.PropertyName);
        }
Beispiel #5
0
        public void Test_Add_ShouldSetUIDefssClassDef()
        {
            //---------------Set up test pack-------------------
            var uiDef            = new UIDefStub();
            var col              = new UIDefCol();
            var expectedClassDef = MockRepository.GenerateStub <IClassDef>();

            col.ClassDef = expectedClassDef;
            //---------------Assert Preconditions---------------
            Assert.IsNull(uiDef.ClassDef);
            //---------------Execute Test ----------------------
            col.Add(uiDef);
            //---------------Test Result -----------------------
            Assert.AreSame(expectedClassDef, uiDef.ClassDef);
        }
Beispiel #6
0
        public void TestProtectedSets()
        {
            UIDefStub uiDef = new UIDefStub();

            Assert.AreEqual("uidef", uiDef.Name);
            uiDef.SetName("newuidef");
            Assert.AreEqual("newuidef", uiDef.Name);

            UIForm uiForm = new UIForm();
            Assert.IsNull(uiDef.UIForm);
            uiDef.SetUIForm(uiForm);
            Assert.AreEqual(uiForm, uiDef.UIForm);

            UIGrid uiGrid = new UIGrid();
            Assert.IsNull(uiDef.UIGrid);
            uiDef.SetUIGrid(uiGrid);
            Assert.AreEqual(uiGrid, uiDef.UIGrid);
        }
Beispiel #7
0
        public void TestProtectedSets()
        {
            UIDefStub uiDef = new UIDefStub();

            Assert.AreEqual("uidef", uiDef.Name);
            uiDef.SetName("newuidef");
            Assert.AreEqual("newuidef", uiDef.Name);

            UIForm uiForm = new UIForm();

            Assert.IsNull(uiDef.UIForm);
            uiDef.SetUIForm(uiForm);
            Assert.AreEqual(uiForm, uiDef.UIForm);

            UIGrid uiGrid = new UIGrid();

            Assert.IsNull(uiDef.UIGrid);
            uiDef.SetUIGrid(uiGrid);
            Assert.AreEqual(uiGrid, uiDef.UIGrid);
        }
Beispiel #8
0
 public void Test_Add_ShouldSetUIDefsGridDefsClassDef()
 {
     //---------------Set up test pack-------------------
     var uiDef = new UIDefStub();
     UIGrid uiGrid = new UIGrid();
     uiDef.SetUIGrid(uiGrid);
     var col = new UIDefCol();
     var expectedClassDef = MockRepository.GenerateStub<IClassDef>();
     col.ClassDef = expectedClassDef;
     //---------------Assert Preconditions---------------
     Assert.IsNull(uiDef.ClassDef);
     //---------------Execute Test ----------------------
     col.Add(uiDef);
     //---------------Test Result -----------------------
     Assert.AreSame(expectedClassDef, uiGrid.ClassDef);
 }