コード例 #1
0
        public void PrepareForSubmit(SubmitRequest request)
        {
            _page.SelectCurrentWeek(request.CurrentWeek);

            _view.InitProgressBar(request.DaysOfWeek.Count);

            foreach (var dayOfweek in request.DaysOfWeek)
            {
                _page.EnterHoursForDay(request.Hours, dayOfweek, request.DayEntry);
                _view.AdvanceOneStep();
            }
        }
コード例 #2
0
        public void notifies_view_about_progress()
        {
            var request = new SubmitRequest
            {
                DaysOfWeek = new List<string> { "Monday", "Tuesday", "Wednesday", "Friday" },
                DayEntry = new DayEntry ()
            };

            _interactor.PrepareForSubmit(request);

            _view.Verify(v => v.InitProgressBar(4));
            _view.Verify(v => v.AdvanceOneStep(), Times.Exactly(4));
        }
コード例 #3
0
        public void prepares_time_card_for_submision()
        {
            var request = new SubmitRequest
                              {
                                  Hours = "8",
                                  CurrentWeek = "11/24/2012",
                                  DaysOfWeek = new List<string> {"Monday", "Friday"},
                                  DayEntry = new DayEntry
                                                 {
                                                     EarningCode = "Billable Hrs",
                                                     ContractLine = "1",
                                                     ContractNumber = "CON001234 OVERHEAD",
                                                     ActivityID = "ADMIN",
                                                     ProjectID = "0012345 Overhead"
                                                 },
                              };

            _interactor.PrepareForSubmit(request);

            _page.Verify(p => p.SelectCurrentWeek("11/24/2012"));
            _page.Verify(p => p.EnterHoursForDay("8", "Monday", request.DayEntry));
            _page.Verify(p => p.EnterHoursForDay("8", "Friday", request.DayEntry));
        }
コード例 #4
0
        private void btnEnterHours_Click(object sender, EventArgs e)
        {
            var interactor = new SubmitInteractor(this, _appDriver);

            var selectedDays = new List<string>(cbDayOfTheWeek.CheckedItems.Cast<object>().Select(item => item.ToString()));

            var request = new SubmitRequest
                              {
                                  Hours = tbHours.Text,
                                  CurrentWeek = cbWeeks.Text,
                                  DaysOfWeek = selectedDays,
                                  DayEntry = new DayEntry
                                                 {
                                                     EarningCode = cbEarningsCode.Text,
                                                     ContractLine = cbContractLine.Text,
                                                     ContractNumber = cbContractNo.Text,
                                                     ActivityID = cbActivityId.Text,
                                                     ProjectID = cbProjectId.Text
                                                 },
                              };

            interactor.PrepareForSubmit(request);
        }