public void Initalize_Should_Set_ProjectList_From_BugService()
        {
            MockRepository repo           = new MockRepository();
            IBugListView   mockBugView    = repo.StrictMock <IBugListView>();
            IBugService    mockBugService = repo.StrictMock <IBugService>();

            IProject[]      mockProjectsArray = new IProject[] { repo.StrictMock <IProject>(), repo.StrictMock <IProject>() };
            List <IProject> projects          = new List <IProject>(mockProjectsArray);

            mockBugService.Expect(svc => svc.GetProjects()).Return(projects);
            mockBugView.Expect(view => view.Projects).SetPropertyWithArgument(projects);
            mockBugView.Expect(view => view.FilterBy).Return(string.Empty).Repeat.Any();
            mockBugView.Expect(view => view.FilterValue).Return(string.Empty).Repeat.Any();
            mockBugView.Expect(view => view.IsBusy).Return(false).Repeat.Any();
            mockBugView.Expect(view => view.IsBusy).SetPropertyAndIgnoreArgument().Repeat.Any();

            repo.ReplayAll();

            IBugListViewPresenter pres = new BugListViewPresenter(mockBugView, mockBugService);

            pres.Initialize();

            mockBugService.VerifyAllExpectations();
            mockBugView.VerifyAllExpectations();
        }
示例#2
0
        public FormBugListView(IBugService svc, ISingleBugViewPresenter sbPres, [Named("ViewSettings")]ISettingsOriginator viewSettings)
        {
            InitializeComponent();

            _presenter = new BugListViewPresenter(this, svc);
            _singleBugPresenter = sbPres;
            _viewSettings = viewSettings;
            SelectedBugs = new ObservableCollection<IBug>();
            Projects = new List<IProject>();
            CommandToApply = new YouTrackCommand() { DisableNotifications = false };

            comboBoxProject.DataSource = bindingSourceProjects;

            //Set up grid
            dataGridViewBugs.Columns.Add(new DataGridViewCheckBoxColumn() { ReadOnly = false, AutoSizeMode = DataGridViewAutoSizeColumnMode.None, Resizable = DataGridViewTriState.False, Width = 20 });
            dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "ID", ReadOnly = true, Resizable = DataGridViewTriState.True });
            dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "Summary", ReadOnly = true, Resizable = DataGridViewTriState.True });
            dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "Description", ReadOnly = true, Resizable = DataGridViewTriState.True, AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill });
            _linkCol = new DataGridViewLinkColumn() { LinkBehavior = LinkBehavior.NeverUnderline, UseColumnTextForLinkValue = true, Text = "view", ReadOnly = true, Resizable = DataGridViewTriState.False, Width = 50, DefaultCellStyle = new DataGridViewCellStyle(dataGridViewBugs.DefaultCellStyle) { Alignment = DataGridViewContentAlignment.MiddleCenter } };
            dataGridViewBugs.Columns.Add(_linkCol);

            dataGridViewBugs.CellContentClick += new DataGridViewCellEventHandler(dataGridViewBugs_CellContentClick);
            bindingSourceProjects.CurrentChanged += (s, ea) => { if (!bindingSourceProjects.IsBindingSuspended) SelectedProject = bindingSourceProjects.Current as IProject; };
            comboBoxPage.SelectedIndexChanged += (s, ea) => UpdatePage();
            comboBoxPage.KeyUp += (s, ea) => { if (ea.KeyCode == Keys.Enter)  UpdatePage(); };
            bindingSourceBugs.DataSourceChanged += new EventHandler(bindingSourceBugs_DataSourceChanged);
            SelectedBugs.CollectionChanged += (s, ea) => labelSelected.Text = String.Format("Selected: {0}", SelectedBugs.Count);
            checkBoxApplyCommand.CheckStateChanged += (s, ea) => { _applyCommand = checkBoxApplyCommand.Checked; };
            textBoxCommand.TextChanged += (s, ea) => { _commandToApply.Command = textBoxCommand.Text; };
        }
示例#3
0
        public void DisplayProjectDetails_Should_Set_Bug_Count_From_BugService()
        {
            MockRepository repo           = new MockRepository();
            IBugListView   mockBugView    = repo.StrictMock <IBugListView>();
            IBugService    mockBugService = repo.StrictMock <IBugService>();
            IProject       mockProject    = repo.StrictMock <IProject>();

            IBug[]      mockBugsArray = new IBug[] { repo.StrictMock <IBug>(), repo.StrictMock <IBug>() };
            List <IBug> mockBugs      = new List <IBug>(mockBugsArray);

            mockBugView.Expect(view => view.SelectedProject).Return(mockProject).Repeat.Twice();
            mockBugService.Expect(svc => svc.GetBugCountForProject(mockProject)).Return(200);
            mockBugView.Expect(view => view.TotalBugs).SetPropertyWithArgument(200);
            mockBugView.Expect(view => view.FilterQuery).Return(string.Empty).Repeat.Any();
            mockBugView.Expect(view => view.IsBusy).Return(false).Repeat.Any();
            mockBugView.Expect(view => view.IsBusy).SetPropertyAndIgnoreArgument().Repeat.Any();

            repo.ReplayAll();

            IBugListViewPresenter pres = new BugListViewPresenter(mockBugView, mockBugService);

            pres.DisplayProjectDetails();

            mockBugService.VerifyAllExpectations();
            mockBugView.VerifyAllExpectations();
        }
        public FormBugListView(IBugService svc, ISingleBugViewPresenter sbPres, [Named("ViewSettings")] ISettingsOriginator viewSettings)
        {
            InitializeComponent();

            _presenter          = new BugListViewPresenter(this, svc);
            _singleBugPresenter = sbPres;
            _viewSettings       = viewSettings;
            SelectedBugs        = new ObservableCollection <IBug>();
            Projects            = new List <IProject>();
            CommandToApply      = new YouTrackCommand()
            {
                DisableNotifications = false
            };

            comboBoxProject.DataSource = bindingSourceProjects;

            //Set up grid
            dataGridViewBugs.Columns.Add(new DataGridViewCheckBoxColumn()
            {
                ReadOnly = false, AutoSizeMode = DataGridViewAutoSizeColumnMode.None, Resizable = DataGridViewTriState.False, Width = 20
            });
            dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn()
            {
                DataPropertyName = "ID", ReadOnly = true, Resizable = DataGridViewTriState.True
            });
            dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn()
            {
                DataPropertyName = "Summary", ReadOnly = true, Resizable = DataGridViewTriState.True
            });
            dataGridViewBugs.Columns.Add(new DataGridViewTextBoxColumn()
            {
                DataPropertyName = "Description", ReadOnly = true, Resizable = DataGridViewTriState.True, AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
            });
            _linkCol = new DataGridViewLinkColumn()
            {
                LinkBehavior = LinkBehavior.NeverUnderline, UseColumnTextForLinkValue = true, Text = "view", ReadOnly = true, Resizable = DataGridViewTriState.False, Width = 50, DefaultCellStyle = new DataGridViewCellStyle(dataGridViewBugs.DefaultCellStyle)
                {
                    Alignment = DataGridViewContentAlignment.MiddleCenter
                }
            };
            dataGridViewBugs.Columns.Add(_linkCol);

            dataGridViewBugs.CellContentClick    += new DataGridViewCellEventHandler(dataGridViewBugs_CellContentClick);
            bindingSourceProjects.CurrentChanged += (s, ea) => { if (!bindingSourceProjects.IsBindingSuspended)
                                                                 {
                                                                     SelectedProject = bindingSourceProjects.Current as IProject;
                                                                 }
            };
            comboBoxPage.SelectedIndexChanged += (s, ea) => UpdatePage();
            comboBoxPage.KeyUp += (s, ea) => { if (ea.KeyCode == Keys.Enter)
                                               {
                                                   UpdatePage();
                                               }
            };
            bindingSourceBugs.DataSourceChanged    += new EventHandler(bindingSourceBugs_DataSourceChanged);
            SelectedBugs.CollectionChanged         += (s, ea) => labelSelected.Text = String.Format("Selected: {0}", SelectedBugs.Count);
            checkBoxApplyCommand.CheckStateChanged += (s, ea) => { _applyCommand = checkBoxApplyCommand.Checked; };
            textBoxCommand.TextChanged             += (s, ea) => { _commandToApply.Command = textBoxCommand.Text; };
        }
        public ErrorService(FrameworkService frameworkService, LanguageService languageService, IBugService bugService, LibraryService libraryService)
        {
            _frameworkService = frameworkService;

            _languageService = languageService;

            _bugService = bugService;

            _libraryService = libraryService;
        }
示例#6
0
 //private bool orent;
 public GameService(SnakeSounds sound)
 {
     POINT           = 15;
     stage           = new GameStageService(STAGE_WIDTH, STAGE_HEIGTH);
     bug             = new BugService(STAGE_WIDTH, STAGE_HEIGTH);
     snake           = new SnakeService();
     food            = new FoodService();
     player          = new PlayerService();
     barrier         = new BarrierService();
     snakeSound      = new SnakeSoundsService(sound.SnakeSound);
     backgroundSound = new GameBackgroundSoundsService(sound.BackgroundSound);
 }
示例#7
0
        private void EatBug(Vector3 snakeHead)
        {
            Vector2 bugCoord = bug.BugCoord();

            if (bugCoord.X == snakeHead.X && bugCoord.Y == snakeHead.Y)
            {
                snakeSound.PlayeSnakeEat();
                snake.GrowSnake(snake.GetSnakeTail());
                bug = new BugService(STAGE_WIDTH, STAGE_HEIGTH);
                player.AddPoint(BUG_POINT);
            }
        }
示例#8
0
        public string OnCommitFinished(IntPtr hParentWnd, string commonRoot, string[] pathList, string logMessage, int revision)
        {
            if (_selectedBugs.Count > 0 && _commandsToProcess.Count > 0)
            {
                try
                {
                    Cursor.Current = Cursors.AppStarting;
                    IBugService svc = _kernel.Get <IBugService>();
                    svc.ApplyCommandsToBugs(_commandsToProcess, _selectedBugs);
                }
                finally
                {
                    Cursor.Current = Cursors.WaitCursor;
                }                //end try

                _selectedBugs.Clear();
                _commandsToProcess.Clear();
            }            //end if

            return(null);
        }
示例#9
0
        /// <summary>重新加载</summary>
        private void Reload()
        {
            if (this.restartCount > 0)
            {
                // 重新加载配置信息
                BugConfigurationView.Instance.Reload();
            }

            this.configuration = BugConfigurationView.Instance.Configuration;

            // 创建对象构建器(Spring.NET)
            string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(BugConfiguration.ApplicationName, springObjectFile);

            // 创建数据服务对象
            this.m_BugService         = objectBuilder.GetObject <IBugService>(typeof(IBugService));
            this.m_BugCategoryService = objectBuilder.GetObject <IBugCategoryService>(typeof(IBugCategoryService));
            this.m_BugCommentService  = objectBuilder.GetObject <IBugCommentService>(typeof(IBugCommentService));
            this.m_BugHistoryService  = objectBuilder.GetObject <IBugHistoryService>(typeof(IBugHistoryService));
        }
示例#10
0
 public BugController(IBugService bugService, IMapper mapper)
 {
     _bugService = bugService;
     _mapper     = mapper;
 }
示例#11
0
 public ProjectController(IProjectService projectService, IUserService userService, IBugService bugService)
 {
     _projectService = projectService;
     _userService    = userService;
     _bugService     = bugService;
 }
 public BugListViewPresenter(IBugListView view, IBugService svc)
 {
     _view = view;
     _svc = svc;
 }
示例#13
0
 public FrameworkBugsController(IBugService bugService, FrameworkService frameworkService, ErrorService errorService)
 {
     _bugService       = bugService;
     _frameworkService = frameworkService;
     _errorService     = errorService;
 }
 public ProjectController()
 {
     projectService           = new ProjectService();
     projectDevelopersService = new ProjectDevelopersService();
     bugService = new BugService();
 }
示例#15
0
 public BugsController(IBugService bugService)
 {
     _bugService = bugService;
 }
 public DashboardController()
 {
     bugService     = new BugService();
     projectService = new ProjectService();
     userService    = new UserService();
 }
 public IdentityController(IBugService bugService, IIdentityService identityService)
 {
     _bugService      = bugService;
     _identityService = identityService;
 }
示例#18
0
 public BugsController(IBugService service)
 {
     _service = service;
 }
示例#19
0
 public UsersController(IBugService bugService, IUserService userService)
 {
     _bugService  = bugService;
     _userService = userService;
 }
示例#20
0
 public TaskController(IBugService bugService)
 {
     _bugService = bugService;
 }
示例#21
0
 public BugListViewPresenter(IBugListView view, IBugService svc)
 {
     _view = view;
     _svc  = svc;
 }
示例#22
0
 public BugController()
 {
     bugService     = new BugService();
     projectService = new ProjectService();
 }