Exemplo n.º 1
0
        public void TestFindAfterUpdating()
        {
            var db = new BookingDB();

            (int, BookingType)key = (1, BookingType.Event);
            List <int> oldValues = new List <int>()
            {
                101, 102, 103
            };
            List <int> newValues = new List <int>()
            {
                201, 202, 203
            };

            db.AddOrUpdate(key, oldValues);
            db.AddOrUpdate(key, newValues);

            var returnedValues = db.Find(key);

            Assert.Equal(newValues, returnedValues);
        }
Exemplo n.º 2
0
        public void TestDbIsNotEmpty()
        {
            var db = new BookingDB();

            (int, BookingType)key = (1, BookingType.Event);
            List <int> values = new List <int>()
            {
                101, 102, 103
            };

            db.AddOrUpdate(key, values);

            Assert.False(db.IsEmpty());
        }
Exemplo n.º 3
0
        public void TestRemove()
        {
            var db = new BookingDB();

            (int, BookingType)key = (1, BookingType.Event);
            List <int> values = new List <int>()
            {
                101, 102, 103
            };

            db.AddOrUpdate(key, values);
            db.Remove(key);

            Assert.Null(db.Find(key));
        }