public ApplicationController(CompositionContainer container, IPresentationService presentationService, IMessageService messageService, ShellService shellService, ProxyController proxyController, DataController dataController) { InitializeCultures(); presentationService.InitializeCultures(); this.container = container; this.dataController = dataController; this.proxyController = proxyController; this.messageService = messageService; this.dataService = container.GetExportedValue<IDataService>(); this.floatingViewModel = container.GetExportedValue<FloatingViewModel>(); this.mainViewModel = container.GetExportedValue<MainViewModel>(); this.userBugsViewModel = container.GetExportedValue<UserBugsViewModel>(); this.teamBugsViewModel = container.GetExportedValue<TeamBugsViewModel>(); shellService.MainView = mainViewModel.View; shellService.UserBugsView = userBugsViewModel.View; shellService.TeamBugsView = teamBugsViewModel.View; this.floatingViewModel.Closing += FloatingViewModelClosing; this.showMainWindowCommand = new DelegateCommand(ShowMainWindowCommandExcute); this.englishCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("en-US"))); this.chineseCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("zh-CN"))); this.settingCommand = new DelegateCommand(SettingDialogCommandExcute, CanSettingDialogCommandExcute); this.aboutCommand = new DelegateCommand(AboutDialogCommandExcute); this.exitCommand = new DelegateCommand(ExitCommandExcute); }
public ApplicationController(CompositionContainer container, IPresentationService presentationService, IMessageService messageService, ShellService shellService, ProxyController proxyController, DataController dataController) { InitializeCultures(); presentationService.InitializeCultures(); this.container = container; this.dataController = dataController; this.proxyController = proxyController; this.messageService = messageService; this.dataService = container.GetExportedValue <IDataService>(); this.floatingViewModel = container.GetExportedValue <FloatingViewModel>(); this.mainViewModel = container.GetExportedValue <MainViewModel>(); this.userBugsViewModel = container.GetExportedValue <UserBugsViewModel>(); this.teamBugsViewModel = container.GetExportedValue <TeamBugsViewModel>(); shellService.MainView = mainViewModel.View; shellService.UserBugsView = userBugsViewModel.View; shellService.TeamBugsView = teamBugsViewModel.View; this.floatingViewModel.Closing += FloatingViewModelClosing; this.showMainWindowCommand = new DelegateCommand(ShowMainWindowCommandExcute); this.englishCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("en-US"))); this.chineseCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("zh-CN"))); this.settingCommand = new DelegateCommand(SettingDialogCommandExcute, CanSettingDialogCommandExcute); this.aboutCommand = new DelegateCommand(AboutDialogCommandExcute); this.exitCommand = new DelegateCommand(ExitCommandExcute); }
public void GenaralUserBugsViewModelTest() { IUserBugsView view = Container.GetExportedValue <IUserBugsView>(); IDataService dataService = Container.GetExportedValue <IDataService>(); UserBugsViewModel viewModel = new UserBugsViewModel(view, dataService); Assert.AreEqual(0, viewModel.Bugs.Count); dataService.UserBugs.Add( new Bug() { ID = 1, Title = "Bug1", Description = "Description for Bug1.", Type = BugType.Red, AssignedTo = "BigEgg", State = "Implement", ChangedDate = new DateTime(2013, 4, 10), CreatedBy = "BigEgg", Priority = "High", Severity = "" } ); dataService.UserBugs.Add( new Bug() { ID = 6, Title = "Bug6", Description = "Description for Bug6.", AssignedTo = "Pupil", State = "Closed", ChangedDate = new DateTime(2013, 4, 11), CreatedBy = "Pupil", Priority = "High", Severity = "High" } ); Assert.AreEqual(2, viewModel.Bugs.Count); Assert.AreEqual(1, viewModel.Bugs.Count(x => x.Type == BugType.Red)); Assert.AreEqual(1, viewModel.Bugs.Count(x => x.Type == BugType.Yellow)); }
public void GenaralUserBugsViewModelTest() { IUserBugsView view = Container.GetExportedValue<IUserBugsView>(); IDataService dataService = Container.GetExportedValue<IDataService>(); UserBugsViewModel viewModel = new UserBugsViewModel(view, dataService); Assert.AreEqual(0, viewModel.Bugs.Count); dataService.UserBugs.Add( new Bug() { ID = 1, Title = "Bug1", Description = "Description for Bug1.", Type = BugType.Red, AssignedTo = "BigEgg", State = "Implement", ChangedDate = new DateTime(2013, 4, 10), CreatedBy = "BigEgg", Priority = "High", Severity = "" } ); dataService.UserBugs.Add( new Bug() { ID = 6, Title = "Bug6", Description = "Description for Bug6.", AssignedTo = "Pupil", State = "Closed", ChangedDate = new DateTime(2013, 4, 11), CreatedBy = "Pupil", Priority = "High", Severity = "High" } ); Assert.AreEqual(2, viewModel.Bugs.Count); Assert.AreEqual(1, viewModel.Bugs.Count(x => x.Type == BugType.Red)); Assert.AreEqual(1, viewModel.Bugs.Count(x => x.Type == BugType.Yellow)); }