public async Task Add_AddNewClientWithIvalidAddress_ShouldNotAddAndReturnNotifications() { //Arrange var cityApiTest = new CityApiTest(_integrationTestFixture); var citiesViewModel = await cityApiTest.GetCitiesAsync(); var clientFixture = new ClientTestFixture(); var clientsViewModel = clientFixture.GenerateClientViewModel(qtyClients: 1, citiesViewModel: citiesViewModel, qtyAddress: 1, isValidAddress: false); //and act var postResponse = await _integrationTestFixture.Client.PostAsJsonAsync(_requestAdd, clientsViewModel.FirstOrDefault()); //Assert var jsonResponse = await postResponse.Content.ReadAsStringAsync(); var clientDeserialized = JsonConvert.DeserializeObject <Deserialize <ClientViewModel> >(jsonResponse); Assert.False(clientDeserialized.Success); Assert.Contains(ConstantMessages.StreetRequiredt_PT, clientDeserialized.Errors); Assert.Contains(ConstantMessages.DistrictRequired_PT, clientDeserialized.Errors); }
public ClientServiceTest(ClientTestFixture clientTestFixture) { _clientTestFixture = clientTestFixture; }
public ClientDomainTest(ClientTestFixture clientTestFixture) { _clientTestFixture = clientTestFixture; }