Exemplo n.º 1
0
        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."));
        }
Exemplo n.º 2
0
        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."));
        }
Exemplo n.º 3
0
        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);
        }