public async void Get_WithEmptyArray_ShouldSucceedAndReturnEmptySet() { // ARRANGE var httpClient = HttpClientStub.Create(c => { c.ForPath(ApiTestPath) .ReturnJsonFor(new object[] { }); }); var sut = new JsonApiClient(httpClient); // ACT var result = await sut.Get <IEnumerable <int> >(ApiTestPath); // ASSERT result.ShouldBeEmpty(); }
public async void Get_WithIntegerArray_ShouldSucceedAndReturnIntegerArray() { // ARRANGE var integerSet = CreateIntegerSet(); var httpClient = HttpClientStub.Create(c => { c.ForPath(ApiTestPath) .ReturnJsonFor(integerSet); }); var sut = new JsonApiClient(httpClient); // ACT var result = await sut.Get <IEnumerable <int> >(ApiTestPath); // ASSERT result.ShouldBe(integerSet); }