public void EditTest() { FakeContext mock = new FakeContext(); FakeUserInterface fakeUserInterface = new FakeUserInterface(); TaskControl ctrl = new TaskControl(mock, fakeUserInterface); ToDoTask obj = new ToDoTask(); const string NAME = "test"; obj.Name = "cos"; ctrl.AddAsync(obj).Wait(); obj.Name = NAME; ctrl.EditAsync(obj).Wait(); Assert.IsTrue(fakeUserInterface.isCalled); Assert.AreEqual(1, mock.ListOfTasks.Count, "Count elements of Tasks is incorrect"); Assert.AreEqual(NAME, mock.ListOfTasks[0].Name, "Name of task is incorrect"); }