コード例 #1
0
ファイル: CompanyTests.cs プロジェクト: Eddersouza/AppEmpresa
        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."));
        }
コード例 #2
0
ファイル: CompanyTests.cs プロジェクト: Eddersouza/AppEmpresa
        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."));
        }
コード例 #3
0
ファイル: CompanyTests.cs プロジェクト: Eddersouza/AppEmpresa
        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);
        }