public void UpdateItemInDatabase() { StorageModule module = (StorageModule)storageTestManager.GetModule(typeof(TestClass)); module.UpdateDatabaseTable(); TestClass testItem = new TestClass { IntProp = 5, StringProp = "asd" }; module.AddItem(testItem); var item = module.GetItemById <TestClass>(1); Assert.AreEqual("asd", item.StringProp); item.IntProp = 999; module.AddItem(item); var editedItem = module.GetItemById <TestClass>(1); Assert.AreEqual(999, editedItem.IntProp); }
public void RemoveItemFromDatabase() { StorageModule module = (StorageModule)storageTestManager.GetModule(typeof(TestClass)); module.UpdateDatabaseTable(); TestClass testItem = new TestClass { IntProp = 5, StringProp = "asd" }; module.AddItem(testItem); var item = module.GetItemById <TestClass>(1); Assert.AreEqual("asd", item.StringProp); module.RemoveItemById <TestClass>(item.Id); var removedItem = module.GetItemById <TestClass>(1); Assert.AreEqual(null, removedItem); }