Пример #1
0
 public static void AssertDb <T>(InOutDatabase <T> db, params T[] array) where T : class
 {
     for (int i = 0; i < db.Count(); i++)
     {
         Assert.AreEqual(db.ToArray()[i], array[i]);
     }
     Assert.AreEqual(db.Count(), array.Length);
 }
Пример #2
0
        private static void TestDb(InOutDatabase <string> store)
        {
            store.Add("House");
            store.Add("Home");
            store.Add("Room");
            TestExtends.AssertDb(store, "House", "Home", "Room");

            var afterHouse = store.GetAllAfter("House").ToArray();

            Assert.AreEqual("Home", afterHouse[0]);
            Assert.AreEqual("Room", afterHouse[1]);

            var afternull = store.GetAllAfter(afterWhich: null).ToArray();

            Assert.AreEqual("House", afternull[0]);
            Assert.AreEqual("Home", afternull[1]);
            Assert.AreEqual("Room", afternull[2]);
        }