Esempio n. 1
0
        public void Given_Valid_Arguments_When_I_Call_CreateDayBatchForSurvey_Then_The_Correct_Service_Method_Is_Called()
        {
            //arrange
            var dayBatchDate = DateTime.Now;

            //act
            _sut.CreateDayBatch(_instrumentName, _serverParkName, dayBatchDate);

            //assert
            _catiServiceMock.Verify(v => v.CreateDayBatch(_connectionModel, _instrumentName,
                                                          _serverParkName, dayBatchDate), Times.Once);
        }
Esempio n. 2
0
        public void CreateDayBatch(string instrumentName, string serverParkName, DayBatchDto dayBatchDto)
        {
            instrumentName.ThrowExceptionIfNullOrEmpty("instrumentName");
            serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName");
            dayBatchDto.ThrowExceptionIfNull("dayBatchDto");

            _blaiseApi.CreateDayBatch(instrumentName, serverParkName, dayBatchDto.DaybatchDate);
        }
Esempio n. 3
0
        public DayBatchDto CreateDayBatch(string instrumentName, string serverParkName, CreateDayBatchDto createDayBatchDto)
        {
            instrumentName.ThrowExceptionIfNullOrEmpty("instrumentName");
            serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName");
            createDayBatchDto.ThrowExceptionIfNull("createDayBatchDto");
            createDayBatchDto.DayBatchDate.ThrowExceptionIfNull("createDayBatchDto.DayBatchDate");
            createDayBatchDto.CheckForTreatedCases.ThrowExceptionIfNull("createDayBatchDto.CheckForTreatedCases");

            var dayBatchModel = _blaiseCatiApi.CreateDayBatch(instrumentName, serverParkName,
                                                              (DateTime)createDayBatchDto.DayBatchDate, (bool)createDayBatchDto.CheckForTreatedCases);

            return(_mapper.MapToDayBatchDto(dayBatchModel));
        }
Esempio n. 4
0
        public void Given_Valid_Arguments_When_I_Call_CreateDayBatch_Then_The_Correct_Service_Method_Is_Called(bool checkForTreatedCases)
        {
            //arrange
            var dayBatchDate = DateTime.Now;

            _caseServiceMock.Setup(c => c.GetNumberOfCases(_connectionModel, _instrumentName, _serverParkName))
            .Returns(1);

            //act
            _sut.CreateDayBatch(_instrumentName, _serverParkName, dayBatchDate, checkForTreatedCases);

            //assert
            _catiServiceMock.Verify(v => v.CreateDayBatch(_connectionModel, _instrumentName,
                                                          _serverParkName, dayBatchDate, checkForTreatedCases), Times.Once);
        }