public async Task ItShouldReturnADeserializedApiResponse() { var response = await this.ApiClient.GetStarShipList(); var deserializer = new ApiResponseDeserializer(); var deserializedResponse = await deserializer.DeserializeResponse(response); Assert.IsNotNull(deserializedResponse.NextPageNumber); Assert.IsFalse(string.IsNullOrWhiteSpace(deserializedResponse.StarShipCount)); Assert.IsFalse(deserializedResponse.StarShips.Any(x => string.IsNullOrWhiteSpace(x.ShipName))); Assert.IsFalse(deserializedResponse.StarShips.Any(x => string.IsNullOrWhiteSpace(x.MegalightsPerHour))); Assert.IsFalse(deserializedResponse.StarShips.Any(x => string.IsNullOrWhiteSpace(x.Consumables))); }
public async Task ItShouldReturnADeserializedApiResponseIfThePageRequestedWasTheLastPage() { //Page 4 is currently the last page for the StarShips API var response = await this.ApiClient.GetStartShipListByPage(4); var deserializer = new ApiResponseDeserializer(); var deserializedResponse = await deserializer.DeserializeResponse(response); Assert.IsNull(deserializedResponse.NextPageNumber); Assert.IsFalse(string.IsNullOrWhiteSpace(deserializedResponse.StarShipCount)); Assert.IsFalse(deserializedResponse.StarShips.Any(x => string.IsNullOrWhiteSpace(x.ShipName))); Assert.IsFalse(deserializedResponse.StarShips.Any(x => string.IsNullOrWhiteSpace(x.MegalightsPerHour))); Assert.IsFalse(deserializedResponse.StarShips.Any(x => string.IsNullOrWhiteSpace(x.Consumables))); }