public void ServiceMustGet() { var service = new ProxyService(this.context); var result = service.Get(); Assert.NotNull(result); }
public async void Get_null_record() { var mock = new ServiceMockFacade <IProxyRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <Proxy>(null)); var service = new ProxyService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.ProxyModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLProxyMapperMock, mock.DALMapperMockFactory.DALProxyMapperMock); ApiProxyResponseModel response = await service.Get(default(string)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>())); }
public async Task <string> GetMusicDetails() { var proxy = new ProxyService(_config["Settings:BaseUrl"]); var response = proxy.Get("api/v1/festivals"); if (!response.IsSuccessStatusCode) { var asyncResult = response.Content.ReadAsStringAsync().Result; Log.Error("MusicService, StatusCode: {0}, Description: {1}, Result: {2}", response.StatusCode, response.ReasonPhrase, asyncResult); throw new Exception("Error occured due to " + asyncResult); } var result = await response.Content.ReadAsStringAsync(); return(RetrieveRecordDetailsDto(result)); }
public override Task <Proxy> Get(Proxy request, ServerCallContext context) { return(Task.FromResult((Proxy)proxyService.Get(request))); }
public IActionResult Get(Guid id) { return(Ok(proxyService.Get(id))); }
public object Get(string url) { return(Content(_service.Get(url), "application/json")); }