public void RemoveLocationTest() { IPopupHelper mockPopuplHelper = new MockPopupHelper(); MainViewModel viewModel = new MainViewModel(); viewModel.PopupHelper = mockPopuplHelper; viewModel.ID = 0; viewModel.RemoveLocationCommand.Execute(null); Thread.Sleep(500); Assert.AreEqual(14, viewModel.DataLayer.GetAllLocations().ToList().Count); }
public void AddLocationTest() { IPopupHelper mockPopuplHelper = new MockPopupHelper(); MainViewModel viewModel = new MainViewModel(); viewModel.LoadDataCommand.Execute(null); viewModel.PopupHelper = mockPopuplHelper; viewModel.ErrorCollection.Add("Name", "Niepoprawny"); viewModel.AddLocationCommand.Execute(null); Thread.Sleep(500); Assert.AreEqual(14, viewModel.DataLayer.GetAllLocations().ToList().Count); }
public void UpdateLocationTest() { IPopupHelper mockPopuplHelper = new MockPopupHelper(); MainViewModel viewModel = new MainViewModel(); viewModel.PopupHelper = mockPopuplHelper; viewModel.ErrorCollection.Add("Name", "Niepoprawny"); viewModel.Name = "Lodz"; viewModel.ID = 1; viewModel.UpdateLocationCommand.Execute(null); Thread.Sleep(500); Assert.AreEqual("Warsaw", viewModel.DataLayer.GetLocation(1).Name); }