public async Task DeleteCompany_CNPJ_Required() { //Arrange UnityOfWorkContract unityOfWork = new ResolveMock().Resolve(); CompanyServiceContract companyService = new CompanyService(unityOfWork); CompanyAppContract _companyApp = new CompanyApp(unityOfWork, companyService); Company company = new Company("", "", null); //Act company = await _companyApp.Delete(company); //Assert Assert.AreEqual(true, company.EventNotification.Warnings.Select(x => x.ToString()).Contains("CNPJ da Empresa é obrigatório.")); }
public async Task DeleteCompany_NotFound() { //Arrange UnityOfWorkContract unityOfWork = new ResolveMock().Resolve(); CompanyServiceContract companyService = new CompanyService(unityOfWork); CompanyAppContract _companyApp = new CompanyApp(unityOfWork, companyService); Company company = new Company("10793548000190", "", null); //Act company = await _companyApp.Delete(company); //Assert Assert.AreEqual(true, company.EventNotification.Warnings.Select(x => x.ToString()).Contains("Empresa não encontrada.")); }
public async Task DeleteCompany() { //Arrange UnityOfWorkContract unityOfWork = new ResolveMock().Resolve(); CompanyServiceContract companyService = new CompanyService(unityOfWork); CompanyAppContract _companyApp = new CompanyApp(unityOfWork, companyService); Company company = new Company("68522679000112", "", null); //Act company = await _companyApp.Delete(company); CompanyList itens = await _companyApp.Get(); //Assert Assert.AreEqual(3, itens.Itens.Count); }