public void RefreshPage() { NewViewModel(); GaleShapleyAlgorithm algorithm = new GaleShapleyAlgorithm(_context.StableMarriage); _context.Algorithms.Add(new AlgorithmData { Name = "test", Algorithm = algorithm, Element = algorithm }); _viewModel.RefreshPage(); Assert.AreEqual(3, _viewModel.Results.Count()); Assert.IsNotNull(_viewModel.Results[2]); Assert.IsTrue(_viewModel.Results[2].Runable); Assert.IsFalse(_viewModel.Results[2].Done); }
private void NewViewModel() { _context = new ModelContext(); _model = new RunModel(_context); _viewModel = new RunViewModel(_model, _context); SetupModel setupModel = new SetupModel(_context); setupModel.Initialize(); ParticipantsModel participantsModel = new ParticipantsModel(_context); participantsModel.Initialize(); PreferencesModel preferencesModel = new PreferencesModel(_context); preferencesModel.Initialize(); AlgorithmModel algorithmModel = new AlgorithmModel(_context); algorithmModel.Initialize(); algorithmModel.CreateGaleShapleyAlgorithm(); algorithmModel.CreateGeneticAlgorithm(); _viewModel.RefreshPage(); }