public DayBatchModel GetDayBatch(string instrumentName, string serverParkName) { instrumentName.ThrowExceptionIfNullOrEmpty("instrumentName"); serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName"); return(_catiService.GetDayBatch(_connectionModel, instrumentName, serverParkName)); }
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)); }
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); }