Пример #1
0
        public void TestExceedingViewModel()
        {
            var viewmodel = new ExceedingsViewModel(exceedingsService);

            ObservableCollection <ExceedingPerCargo> expectedData = new ObservableCollection <ExceedingPerCargo>(exceedingsService.All());
            var exceeding = exceedingsService.Find(1);

            viewmodel.SelectedExceeding = exceeding;

            Assert.AreEqual(expectedData.Count, viewmodel.Exceedings.Count);
            Assert.IsNotNull(viewmodel.SelectedExceeding);
            Assert.AreEqual(1, viewmodel.SelectedExceeding.Exceeding_per_cargo_id);
        }
        private void LoadData()
        {
            var dummy = service.All().OrderBy(d => d.Exceeding_per_cargo_id);

            Exceedings = new ObservableCollection <ExceedingPerCargo>(dummy);
        }