Ejemplo n.º 1
0
 public void ListCompaniesSuccessfully()
 {
     var repo = new CompanyRepository();
     var companies = repo.ListCompanies();
     Assert.IsNotNull(companies);
     Assert.IsTrue(companies.Any());
 }
Ejemplo n.º 2
0
 public void GetCompanyByIdSuccessfully()
 {
     var repo = new CompanyRepository();
     var company = repo.GetCompanyById("e466dfb4-f05c-4c7f-92a3-09a0a28c7af5");
     Assert.IsNotNull(company);
     Assert.AreEqual("e466dfb4-f05c-4c7f-92a3-09a0a28c7af5",company.Id);
 }
Ejemplo n.º 3
0
        public void ListCompaniesSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/companies_list.json");

            var client = GetMockClient(content);
            var repo = new CompanyRepository(client.Object);
            var companies = repo.ListCompanies();
            client.VerifyAll();
            Assert.IsNotNull(companies);
            Assert.IsTrue(companies.Any());
        }
Ejemplo n.º 4
0
        public void GetCompanyByIdSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/companies_get_by_id.json");

            var client = GetMockClient(content);
            var repo = new CompanyRepository(client.Object);
            var company = repo.GetCompanyById("e466dfb4-f05c-4c7f-92a3-09a0a28c7af5");
            client.VerifyAll();
            Assert.IsNotNull(company);
            Assert.AreEqual("e466dfb4-f05c-4c7f-92a3-09a0a28c7af5",company.Id);
        }
Ejemplo n.º 5
0
 public void EditCompanySuccessfully()
 {
     var repo = new CompanyRepository();
     var editedCompany = repo.EditCompany(new Company
     {
         Id = "739dcfc5-adf0-4a00-b639-b4e05922994d",
         LegalName = "Test company #2",
         Name = "Test company #2",
         Country = "AUS"
     });
     Assert.AreEqual("Test company #2", editedCompany.Name);
 }
Ejemplo n.º 6
0
 public void CreateCompanySuccessfully()
 {
     var repo = new CompanyRepository();
     var createdCompany = repo.CreateCompany(new Company
     {
         LegalName = "Test company #1",
         Name = "Test company #1",
         Country = "AUS"
     });
     Assert.IsNotNull(createdCompany);
     Assert.IsNotNull(createdCompany.Id);
 }
Ejemplo n.º 7
0
        public void EditCompanySuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/companies_edit.json");

            var client = GetMockClient(content);
            var repo = new CompanyRepository(client.Object);
            var editedCompany = repo.EditCompany(new Company
            {
                Id = "739dcfc5-adf0-4a00-b639-b4e05922994d",
                LegalName = "Test company #2",
                Name = "Test company #2",
                Country = "AUS"
            });
            client.VerifyAll();
            Assert.AreEqual("Test company #2", editedCompany.Name);
        }
Ejemplo n.º 8
0
        public void CreateCompanySuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/companies_create.json");

            var client = GetMockClient(content);
            var repo = new CompanyRepository(client.Object);
            var createdCompany = repo.CreateCompany(new Company
            {
                LegalName = "Test company #1",
                Name = "Test company #1",
                Country = "AUS"
            });
            client.VerifyAll();
            Assert.IsNotNull(createdCompany);
            Assert.IsNotNull(createdCompany.Id);
        }