public IHttpActionResult GetServerPark([FromUri] string serverParkName) { var park = _serverParkService.GetServerPark(serverParkName); _loggingService.LogInfo($"Successfully received server park '{serverParkName}'"); return(Ok(park)); }
public void Given_I_Call_GetServerPark_Then_The_Correct_Method_Is_called_On_The_Api() { //arrange var serverPark1Mock = new Mock <IServerPark>(); serverPark1Mock.Setup(s => s.Name).Returns(_serverParkName); _blaiseApiMock.Setup(b => b.GetServerPark(_serverParkName)) .Returns(serverPark1Mock.Object); //act _sut.GetServerPark(_serverParkName); //assert _blaiseApiMock.Verify(v => v.GetServerPark(_serverParkName), Times.Once); _mapperMock.Verify(v => v.MapToServerParkDto(serverPark1Mock.Object)); }
public IServerPark GetServerPark(string serverParkName) { serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName"); return(_parkService.GetServerPark(_connectionModel, serverParkName)); }
public IEnumerable<ISurvey> GetSurveys(ConnectionModel connectionModel, string serverParkName) { var serverPark = _parkService.GetServerPark(connectionModel, serverParkName); return serverPark.Surveys; }