public void ViewModelTestDeleteAGroup() { Group m = new Group(); m.Setup(); m.testMode = true; FirstPageViewModel vm = new FirstPageViewModel(m); vm.NewGroup = "Test"; FlashCard card = new FlashCard("Example question", "Example answer", "Test"); vm.AddGroupToList(); ListOfUniqueGroups L = new ListOfUniqueGroups(); L.Name = "Test"; vm.DeleteItem(L); bool found = false; foreach (FlashCard f in vm.FlashCards) { if (f.ToString() == card.ToString()) { found = true; } } Assert.IsFalse(found); // this should be false }
public void ViewModelTestEditACard() { Group m = new Group(); m.Setup(); m.testMode = true; FlashCard card = new FlashCard("Question", "Answer", "Test"); FlashCard newCard = new FlashCard("que", "ans", "Test"); m.Cards.Add(card); FlashCardsViewModel vm = new FlashCardsViewModel("Test", m.Cards, m); vm.EditFlashCard(card, newCard); bool found = false; foreach (FlashCard f in vm.AllCards) { if (f.ToString() == card.ToString()) { found = true; } } Assert.IsFalse(found); // this should be false }
public void ViewModelTestAddACard() { Group m = new Group(); m.Setup(); m.testMode = true; FlashCardsViewModel vm = new FlashCardsViewModel("Test", m.Cards, m); FlashCard card = new FlashCard("Example question", "Example answer", "Test"); vm.AddFlashCard(card); bool found = false; foreach (FlashCard f in vm.AllCards) { if (f.ToString() == card.ToString()) { found = true; } } Assert.IsTrue(found); // this should be true }
public void ViewModelTestAddAGroup() { Group m = new Group(); m.Setup(); m.testMode = true; FirstPageViewModel vm = new FirstPageViewModel(m); vm.NewGroup = "Test"; FlashCard card = new FlashCard("Example question", "Example answer", "Test"); vm.AddGroupToList(); bool found = false; foreach (FlashCard f in vm.FlashCards) { if (f.ToString() == card.ToString()) { found = true; } } Assert.IsTrue(found); // this should be true }