public async Task ListAsync_ShouldReturnTwoCounterparties_Async() { var counterpartyList = await this.repository.ListAsync(); var companyA = counterpartyList.SingleOrDefault(counterparty => counterparty.Id == 1); CounterpartyAssert.IsCounterpartyId1(companyA); var companyB = counterpartyList.SingleOrDefault(counterparty => counterparty.Id == 2); CounterpartyAssert.IsCounterpartyId2(companyB); }
public async Task GetCounterparties_ShouldReturnSuccessAndTwoCounterparties_Async() { var httpResponseMessage = await this.client.GetAsync("/api/counterparties"); var content = await httpResponseMessage.Content.ReadAsStringAsync(); Assert.IsTrue(httpResponseMessage.IsSuccessStatusCode); var settings = new JsonSerializerSettings { ContractResolver = PrivateResolver.Default }; var list = JsonConvert.DeserializeObject <List <Counterparty> >(content, settings); Assert.AreEqual(2, list.Count); CounterpartyAssert.IsCounterpartyId1(list.SingleOrDefault(item => item.Id == 1)); CounterpartyAssert.IsCounterpartyId2(list.SingleOrDefault(item => item.Id == 2)); }
public async Task FindAsync_ShouldReturnCounterpartyForCounterpartyId1_Async() { var companyA = await this.repository.FindAsync(1); CounterpartyAssert.IsCounterpartyId1(companyA); }