Esempio n. 1
0
 public void Add_Cancelled()
 {
     testViewModel = new BatchEditWindowTestViewModel(mgr, new TestMessageBox(), new AddWindowWithFalse());
     testViewModel.Refresh();
     Assert.AreEqual(3, testViewModel.Collection.Count);
     testViewModel.Add();
     Assert.AreEqual(3, testViewModel.Collection.Count);
 }
Esempio n. 2
0
 public void Delete_Cancelled()
 {
     testViewModel = new BatchEditWindowTestViewModel(mgr, new DeleteMailboxWindowFalse(), new EditWindowWithFalse());
     testViewModel.Refresh();
     Assert.AreEqual(3, testViewModel.Collection.Count);
     testViewModel.Collection.CurrentItem = testViewModel.Collection[2];
     testViewModel.Delete();
     Assert.AreEqual(3, testViewModel.Collection.Count);
 }
Esempio n. 3
0
 public void Modify()
 {
     testViewModel = new BatchEditWindowTestViewModel(mgr, new TestMessageBox(), new EditWindowWithTrue());
     testViewModel.Refresh();
     Assert.AreEqual(3, testViewModel.Collection.Count);
     testViewModel.Collection.CurrentItem = testViewModel.Collection[2];
     testViewModel.Modify();
     Assert.AreEqual(3, testViewModel.Collection.Count);
     Assert.AreEqual("Test", testViewModel.Collection.CurrentItem.Name);
 }
Esempio n. 4
0
        public void Add()
        {
            testViewModel = new BatchEditWindowTestViewModel(mgr, new TestMessageBox(), new AddWindowWithTrue());
            testViewModel.Refresh();
            Assert.AreEqual(3, testViewModel.Collection.Count);
            testViewModel.Add();
            testViewModel.Save();
            Assert.AreEqual(4, testViewModel.Collection.Count);
            var data = new EditableData();

            Assert.AreEqual(data.CreateNewData().Name, testViewModel.Collection[3].Name);
        }
Esempio n. 5
0
        public void Modify_Cancelled()
        {
            testViewModel = new BatchEditWindowTestViewModel(mgr, new TestMessageBox(), new EditWindowWithFalse());
            testViewModel.Refresh();
            Assert.AreEqual(3, testViewModel.Collection.Count);
            testViewModel.Collection.CurrentItem = testViewModel.Collection[2];
            var name = testViewModel.Collection.CurrentItem.Name;

            testViewModel.Modify();
            Assert.AreEqual(3, testViewModel.Collection.Count);
            //the data should not be changed when operation was cancelled.
            Assert.AreEqual(name, testViewModel.Collection.CurrentItem.Name);
        }