public async Task GetLiveAuctionsShouldReturnAllLiveAuctions() { await ApiCalls.PostCreateAuction(_client, new CreateAuctionDto { StartingPrice = 15.0m, Description = "Guitar" }); await ApiCalls.PostCreateAuction(_client, new CreateAuctionDto { StartingPrice = 20.0m, Description = "Piano" }); var getResponse = await ApiCalls.GetLiveAuctions(_client); Assert.Equal(HttpStatusCode.OK, getResponse.StatusCode); var content = await getResponse.Content.ReadAsStringAsync(); var auctions = JsonConvert.DeserializeObject <List <AuctionReadModel> >(content); Assert.Equal(2, auctions.Count); }
public async Task CreateAuctionReturns200IfSuccessful() { var auction = new CreateAuctionDto { StartingPrice = 15.0m, Description = "Guitar" }; var postResponse = await ApiCalls.PostCreateAuction(_client, auction); Assert.Equal(HttpStatusCode.OK, postResponse.StatusCode); }