예제 #1
0
        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
        }
예제 #2
0
 public EditGroupViewModel(FirstPageViewModel firstPageViewModel, string name)
 {
     this.firstPageViewModel = firstPageViewModel;
     oldGroup    = name;
     Name        = name;
     SaveCommand = new Command(execute: () =>
     {
         firstPageViewModel.EditGroupName(oldGroup, Name);
         Navigation.PopAsync();
     });
 }