Exemple #1
0
        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);
        }
Exemple #2
0
 public ClientServiceTest(ClientTestFixture clientTestFixture)
 {
     _clientTestFixture = clientTestFixture;
 }
Exemple #3
0
 public ClientDomainTest(ClientTestFixture clientTestFixture)
 {
     _clientTestFixture = clientTestFixture;
 }