public void Test_Update_UpdatesCharacterWithNewValues() { Character testCharacter = new Character("Artorias", 0,1, 1,1,1); testCharacter.Save(); testCharacter.SetName("Guts"); testCharacter.Update(); Character resultCharacter = Character.Find(testCharacter.GetId()); Character test = new Character("Guts", 0,1, 1,1,1, testCharacter.GetId()); Assert.Equal(test, resultCharacter); }
public void Test_Find_FindsCharacterInDatabase() { Character testCharacter = new Character("Artorias", 0,1, 1,1,1); testCharacter.Save(); Character foundCharacter = Character.Find(testCharacter.GetId()); Assert.Equal(testCharacter, foundCharacter); }
public void Test_Delete_DeletesCharacterFromDatabase() { Character testCharacter1 = new Character("Artorias", 0,1, 1,1,1); testCharacter1.Save(); Character testCharacter2 = new Character("Guts", 0,1, 1,1,1); testCharacter2.Save(); Character.Delete(testCharacter1.GetId()); List<Character> testList = new List<Character>{testCharacter2}; List<Character> resultList = Character.GetAll(); Assert.Equal(testList, resultList); }