public void ViewModelTestEditAGroup() { 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(); vm.EditGroupName("Test", "Edit"); bool found = false; foreach (FlashCard f in vm.FlashCards) { if (f.Group == card.Group) { found = true; } } Assert.IsFalse(found); // this should be false }
public EditGroupViewModel(FirstPageViewModel firstPageViewModel, string name) { this.firstPageViewModel = firstPageViewModel; oldGroup = name; Name = name; SaveCommand = new Command(execute: () => { firstPageViewModel.EditGroupName(oldGroup, Name); Navigation.PopAsync(); }); }