public void Test_MarkItem_ReturnsAStringEndingWIthCompleted() { //Arrange ViewModel viewmodel = new ViewModel(); string value = "Meeting"; //Act viewmodel.MarkitemCommand.Execute(value); //Assert //Assert.AreEqual() }
public void Test_ViewItems_ReturnsEmptyList_IfNoItemsAreInTheList() { //Arrange ViewModel viewmodel = new ViewModel(); ObservableCollection<string> collection = new ObservableCollection<string>(); //Act viewmodel.newList = collection; viewmodel.viewItemsCommand.Execute(null); //Assert Assert.AreEqual(0,viewmodel.newList.Count); }
public void Test_AddItem_AddsAnItemToTheListWhenGivenAnItem() { //Arrange ViewModel viewmodel = new ViewModel(); string value = "meeting"; ObservableCollection<string> expectedList = new ObservableCollection<string>() { value }; //Act viewmodel.additemCommand.Execute(value); //Assert Assert.AreEqual(expectedList.Count , viewmodel.schedule.list.Count); }
public void Test_AddItem_AddsMoreThanOneItemWhenPassedMoreThanOneItem() { //Arrange ViewModel viewmodel = new ViewModel(); string value = "meeting"; string value2 = "lunch"; ObservableCollection<string> expectedList = new ObservableCollection<string>() { value, value2 }; //Act viewmodel.additemCommand.Execute(value); viewmodel.additemCommand.Execute(value2); //Assert Assert.AreEqual(expectedList.Count, viewmodel.schedule.list.Count); }
public void Test_RemoveItemMethodwhenoneObjectIsInTheCollection_ReturnszerowhentheOnlyObjectIsRemoved() { //Arrange viewmodel = new ViewModel(); string value = "meeting"; expectedList = new ObservableCollection<string>() { value }; expectedList.Remove(value); //Act viewmodel.additemCommand.Execute(value); viewmodel.RemoveitemCommand.Execute(value); //Assert Assert.AreEqual(expectedList.Count, viewmodel.newList.Count); }
public void Test_Test_RemoveItemMethodwhenTwoObjectsAreInTheCollection_ReturnsOnewhentheOnlyOneObjectIsRemoved() { //Arrange viewmodel = new ViewModel(); string value = "meeting"; string value2 = "Babbage meeting"; expectedList = new ObservableCollection<string>() { value, value2 }; //Act //Adds two schedules to the expectedList and the actual list in the viewmodel viewmodel.additemCommand.Execute(value); viewmodel.additemCommand.Execute(value2); //Removes only one item expectedList.Remove(value); viewmodel.RemoveitemCommand.Execute(value); //Assert Assert.AreEqual(expectedList.Count, viewmodel.schedule.list.Count); }
public void Setup() { viewmodel = null; expectedList = null; }
public void CleanUp() { viewmodel = null; expectedList = null; }