Ejemplo n.º 1
0
        public void TestThisIndexer()
        {
            KeyDef             keyDef = new KeyDef("mykey");
            KeyDefColInheritor col    = new KeyDefColInheritor();

            col.Add(keyDef);
            Assert.AreEqual(keyDef, col.GetThis("mykey"));
        }
Ejemplo n.º 2
0
 public void TestRemove()
 {
     KeyDef keyDef = new KeyDef();
     KeyDefColInheritor col = new KeyDefColInheritor();
     
     col.CallRemove(keyDef);
     col.Add(keyDef);
     Assert.AreEqual(1, col.Count);
     col.CallRemove(keyDef);
     Assert.AreEqual(0, col.Count);
 }
Ejemplo n.º 3
0
        public void TestRemove()
        {
            KeyDef             keyDef = new KeyDef();
            KeyDefColInheritor col    = new KeyDefColInheritor();

            col.CallRemove(keyDef);
            col.Add(keyDef);
            Assert.AreEqual(1, col.Count);
            col.CallRemove(keyDef);
            Assert.AreEqual(0, col.Count);
        }
Ejemplo n.º 4
0
        public void TestThisIndexerException()
        {
            //---------------Set up test pack-------------------
            KeyDefColInheritor col = new KeyDefColInheritor();

            //---------------Execute Test ----------------------
            try
            {
                col.GetThis("mykey");
                Assert.Fail("Expected to throw an ArgumentException");
            }
            //---------------Test Result -----------------------
            catch (ArgumentException ex)
            {
                StringAssert.Contains("does not exist in the collection of key definitions", ex.Message);
            }
        }
Ejemplo n.º 5
0
 public void TestThisIndexer()
 {
     KeyDef keyDef = new KeyDef("mykey");
     KeyDefColInheritor col = new KeyDefColInheritor();
     col.Add(keyDef);
     Assert.AreEqual(keyDef, col.GetThis("mykey"));
 }
Ejemplo n.º 6
0
 public void TestThisIndexerException()
 {
     //---------------Set up test pack-------------------
     KeyDefColInheritor col = new KeyDefColInheritor();
     //---------------Execute Test ----------------------
     try
     {
         col.GetThis("mykey");
         Assert.Fail("Expected to throw an ArgumentException");
     }
         //---------------Test Result -----------------------
     catch (ArgumentException ex)
     {
         StringAssert.Contains("does not exist in the collection of key definitions", ex.Message);
     }
 }