示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }