public void SQLiteItemTest_AddBan() { Assert.IsNotNull(manager); Assert.IsFalse(manager.ItemIsBanned("Dirt Block"), "Item isn't banned"); manager.AddNewBan("Dirt Block"); Assert.IsTrue(manager.ItemIsBanned("Dirt Block"), "New item is added"); Assert.IsFalse(manager.ItemIsBanned("Green Brick"), "Item isn't banned"); manager.AddNewBan("Green Brick"); Assert.IsTrue(manager.ItemIsBanned("Green Brick"), "New item is added"); Assert.AreEqual(2, manager.ItemBans.Count, "Adding both items"); manager.AddNewBan("Green Brick"); Assert.AreEqual(2, manager.ItemBans.Count, "Adding duplicate items"); }
public void SQLiteItemTest_RemoveBan() { manager = new ItemManager(DB); Assert.IsNotNull(manager); Assert.AreEqual(2, manager.ItemBans.Count); manager.AddNewBan("Dirt Block"); Assert.AreEqual(2, manager.ItemBans.Count); Assert.AreEqual(true, manager.ItemIsBanned("Dirt Block")); manager.RemoveBan("Dirt Block"); manager.UpdateItemBans(); Assert.AreEqual(1, manager.ItemBans.Count); Assert.AreEqual(false, manager.ItemIsBanned("Dirt Block")); manager.RemoveBan("Dirt Block"); Assert.AreEqual(false, manager.ItemIsBanned("Dirt Block")); Assert.AreEqual(true, manager.ItemIsBanned("Green Brick")); manager.RemoveBan("Green Brick"); Assert.AreEqual(false, manager.ItemIsBanned("Green Brick")); }