private void AddClientHourRegistration(ProjectRegistration projectRegistration, ForecastRegistrationDateColumn dateColumn, decimal hours)
        {
            var clientHourReg = new ProjectHourRegistration(projectRegistration)
            {
                Hours = hours
            };

            dateColumn.AddProjectHours(clientHourReg);
        }
        private void AddDateColumnWithClientRegistration(ProjectRegistration projectRegistration, decimal hours, bool isEditEnabled)
        {
            var dateColumn             = new ForecastRegistrationDateColumn(new DateTime(2013, 1, 1));
            var clientHourRegistration = new ProjectHourRegistration(projectRegistration)
            {
                Hours         = hours,
                IsEditEnabled = isEditEnabled
            };

            dateColumn.AddProjectHours(clientHourRegistration);
            projectRegistration.Registrations.Add(clientHourRegistration);
        }
Beispiel #3
0
        public void IsEmptyProjectRegistration_IsTypeProjectAndHasProjectHours_ReturnsFalse()
        {
            // Arrange
            var frame = new DispatcherFrame();
            var sut   = new ForecastRegistrationDateColumn(new DateTime(2013, 1, 1))
            {
                ForecastTypeRegistration =
                    new ForecastTypeRegistration(ForecastTestData.ProjectHoursOnlyForecastType,
                                                 ForecastTestData.ForecastTypesList)
            };

            sut.AddProjectHours(new ProjectHourRegistration(new ProjectRegistration()));

            // Act
            var result = sut.IsEmptyProjectRegistration(ForecastTestData.ProjectHoursOnlyForecastType.Id);

            // Assert
            Assert.That(result, Is.False);
        }
        private IEnumerable <ProjectHourRegistration> CreateHoursForMonth(int month, int year, decimal defaultHours, ProjectRegistration parent)
        {
            var result = new List <ProjectHourRegistration>();
            var day    = new DateTime(year, month, 1);

            while (day.Month == month)
            {
                if (!day.IsWeekend())
                {
                    var dateColumn = new ForecastRegistrationDateColumn(day);
                    var hourReg    = new ProjectHourRegistration(parent)
                    {
                        Hours = defaultHours
                    };
                    dateColumn.AddProjectHours(hourReg);
                    result.Add(hourReg);
                }

                day = day.AddDays(1);
            }
            return(result);
        }