public void InsertTest() { // Arrange bool found = false; deckDB = new DeckDB(); List <DeckModel> beforeDecks = (List <DeckModel>)deckDB.GetAll(); var testDeck = new DeckModel() { DeckName = "TestDeck" }; //Act deckDB.Insert(testDeck); List <DeckModel> afterDecks = (List <DeckModel>)deckDB.GetAll(); //Assert Assert.IsTrue(beforeDecks.Count < afterDecks.Count); //Cleanup for (int i = 0; i < afterDecks.Count && !found; i++) { if (afterDecks[i].DeckName == testDeck.DeckName) { testDeck.Id = afterDecks[i].Id; found = true; } } deckDB.Delete(testDeck); }
public void GetAllTest() { // Arrange deckDB = new DeckDB(); //Act List <DeckModel> decks = (List <DeckModel>)deckDB.GetAll(); //Assert Assert.IsTrue(decks.Count > 0); }