Ejemplo n.º 1
0
        public DayBatchModel GetDayBatch(string instrumentName, string serverParkName)
        {
            instrumentName.ThrowExceptionIfNullOrEmpty("instrumentName");
            serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName");

            return(_catiService.GetDayBatch(_connectionModel, instrumentName, serverParkName));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetDayBatch([FromUri] string serverParkName, [FromUri] string instrumentName)
        {
            _loggingService.LogInfo($"Get a daybatch for instrument '{instrumentName}' on server park '{serverParkName}'");

            var dayBatchDto = _catiService.GetDayBatch(instrumentName, serverParkName);

            _loggingService.LogInfo($"Daybatch retrieved for instrument '{instrumentName}' for '{dayBatchDto.DayBatchDate}'");

            return(Ok(dayBatchDto));
        }
Ejemplo n.º 3
0
        public void Given_A_DayBatch_Exists_When_I_Call_GetDayBatch_Then_The_Correct_Service_Is_Called()
        {
            //arrange
            const string instrumentName = "OPN2101A";
            const string serverParkName = "ServerParkA";

            _blaiseCatiApiMock.Setup(b => b.GetDayBatch(instrumentName, serverParkName)).Returns(new DayBatchModel());

            _mapperMock.Setup(m => m.MapToDayBatchDto(It.IsAny <DayBatchModel>()))
            .Returns(new DayBatchDto());

            //act
            _sut.GetDayBatch(instrumentName, serverParkName);

            //assert
            _blaiseCatiApiMock.Verify(v => v.GetDayBatch(instrumentName, serverParkName), Times.Once);
        }