public void Constructor_WithApiBase_SetsApiBase() { var apiRoot = "http://example.com"; var client = new ErgastClient(apiRoot); client.ApiBase.Should().Be(apiRoot); }
public ErgastClientTests() { Cache = Substitute.For <IErgastCache>(); UrlBuilder = Substitute.For <IUrlBuilder>(); HttpClient = Substitute.For <IHttpClient>(); ResponseMessage = Substitute.For <HttpResponseMessage>(); ResponseMessage.Content = new StringContent("{ Data: {} }"); HttpClient.GetAsync(null).ReturnsForAnyArgs(x => ResponseMessage); Client = new ErgastClient { Cache = Cache, UrlBuilder = UrlBuilder, HttpClient = HttpClient }; }