public ForecastSearchByRegistrationService(IForecastMonthRepository forecastMonthRepository
                                            , ForecastMonthSearchCriteriaCollector criteriaCollector
                                            , HolidaysByPeriodProvider holidaysByPeriodProvider
                                            , IDomainSettings domainSettings)
 {
     _forecastMonthRepository  = forecastMonthRepository;
     _criteriaCollector        = criteriaCollector;
     _holidaysByPeriodProvider = holidaysByPeriodProvider;
     _domainSettings           = domainSettings;
 }
        public void Collect_ForecastIdHasValue_ResultContainsForcastTypeQueryCriteria()
        {
            // Arrange
            var sut = new ForecastMonthSearchCriteriaCollector();

            // Act
            var result = sut.Collect(new ForecastSearchByRegistrationRequest {
                ForecastTypeId = 1
            });

            // Assert
            Assert.That(result.Single(), Is.InstanceOf <ForcastTypeQueryCriteria>());
        }
        public void Collect_BothProjectIdAndCompanyIdHasValue_ThrowsException()
        {
            // Arrange
            var sut = new ForecastMonthSearchCriteriaCollector();

            // Act
            var exception = Assert.Throws <Exception>(() => sut.Collect(new ForecastSearchByRegistrationRequest {
                CompanyId = 1, ProjectId = 2
            }));

            // Assert
            Assert.That(exception.Message, Is.EqualTo("CompanyId and ProjectId search combination does not make sence"));
        }