Example #1
0
        public void TestAddDuplicateBOProp()
        {
            try
            {
                IBOKey boKey = _keyDef1.CreateBOKey(_boPropCol1);
                boKey.Add(boKey["PropName"]);

                Assert.Fail("Expected to throw an InvalidPropertyException");
            }
            //---------------Test Result -----------------------
            catch (InvalidPropertyException ex)
            {
                StringAssert.Contains("already exists in the key collection", ex.Message);
            }
        }
Example #2
0
        public void TestAddNullBOProp()
        {
            try
            {
                IBOKey boKey = _keyDef1.CreateBOKey(_boPropCol1);
                boKey.Add(null);

                Assert.Fail("Expected to throw an HabaneroArgumentException");
            }
            //---------------Test Result -----------------------
            catch (HabaneroArgumentException ex)
            {
                StringAssert.Contains("The argument 'boProp' is not valid. boProp cannot be null", ex.Message);
            }
        }