public void Test_BOPropLookupList_CreateWithLookupList()
        {
            //---------------Set up test pack-------------------
            PropDef def = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null)
            {
                LookupList = new SimpleLookupList(_collection)
            };

            //---------------Assert Precondition----------------
            Assert.IsTrue(def.HasLookupList());
            //---------------Execute Test ----------------------
            BOPropLookupList boPropLookupList = new BOPropLookupList(def);

            //---------------Test Result -----------------------
            Assert.IsNotNull(boPropLookupList);
        }
        public void Test_BOPropLookupList_CreateNoLookupList_DefaultConstructor()
        {
            //---------------Set up test pack-------------------
            PropDef def = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null);

            //---------------Assert Precondition----------------
            Assert.IsFalse(def.HasLookupList());
            //---------------Execute Test ----------------------
            try
            {
                new BOPropLookupList(def, NewGuidAsStdString());
                Assert.Fail("expected Err");
            }
            //---------------Test Result -----------------------
            catch (HabaneroDeveloperException ex)
            {
                StringAssert.Contains("The application tried to configure a BOPropLookupList - with the propDef", ex.DeveloperMessage);
                StringAssert.Contains("does not have a lookup list defined", ex.DeveloperMessage);
            }
        }
Пример #3
0
        public void TestCreateBOProp_CorrectPropCreated()
        {            
            //---------------Set up test pack-------------------
            PropDef propDef = new PropDef("PropName", typeof(int), PropReadWriteRule.ReadWrite, null);

            //-----Test PreCondition--------------------------
            Assert.IsFalse(propDef.HasLookupList());

            //---------------Execute Test ----------------------

            IBOProp prop = propDef.CreateBOProp(false);
            //---------------Test Result -----------------------

            Assert.IsInstanceOf(typeof(BOProp), prop);

        }
Пример #4
0
 public void TestCreateBOPropWithLookupList_CorrectPropCreated_WithDefaultValue()
 {
     //---------------Set up test pack-------------------
     PropDef propDef = new PropDef("PropName", typeof(int), PropReadWriteRule.ReadWrite, null,99);
     Dictionary<string, string> collection = new Dictionary<string, string>();
     SimpleLookupList simpleLookupList = new SimpleLookupList(collection);
     propDef.LookupList = simpleLookupList;
     //-----Test PreCondition--------------------------
     Assert.IsTrue(propDef.HasLookupList());
     //---------------Execute Test ----------------------
     IBOProp prop = propDef.CreateBOProp(true);
     //---------------Test Result -----------------------
     Assert.IsInstanceOf(typeof(BOPropLookupList), prop);
 }
 public void Test_BOPropLookupList_CreateWithLookupList()
 {
     //---------------Set up test pack-------------------
     PropDef def = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null)
                       {LookupList = new SimpleLookupList(_collection)};
     //---------------Assert Precondition----------------
     Assert.IsTrue(def.HasLookupList());
     //---------------Execute Test ----------------------
     BOPropLookupList boPropLookupList = new BOPropLookupList(def);
     //---------------Test Result -----------------------
     Assert.IsNotNull(boPropLookupList);
 }
 public void Test_BOPropLookupList_CreateNoLookupList_DefaultConstructor()
 {
     //---------------Set up test pack-------------------
     PropDef def = new PropDef("PropName", typeof(Guid), PropReadWriteRule.ReadWrite, null);
     //---------------Assert Precondition----------------
     Assert.IsFalse(def.HasLookupList());
     //---------------Execute Test ----------------------
     try
     {
         new BOPropLookupList(def, NewGuidAsStdString());
         Assert.Fail("expected Err");
     }
     //---------------Test Result -----------------------
     catch (HabaneroDeveloperException ex)
     {
         StringAssert.Contains("The application tried to configure a BOPropLookupList - with the propDef", ex.DeveloperMessage);
         StringAssert.Contains("does not have a lookup list defined", ex.DeveloperMessage);
     }
 }