예제 #1
0
 public void EditCompany(CompanyModel company)
 {
     try
     {
         CompanyDAL companyDAL = new CompanyDAL();
         companyDAL.EditCompany(company);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
        public void EditCompanyTest()
        {
            CompanyDAL   companyDAL = new CompanyDAL();
            int          companyId  = companyDAL.GetCompanies().Select(x => x.Id).Max();
            CompanyModel model      = new CompanyModel()
            {
                Id = companyId, Address = "testAddress"
            };

            companyDAL.EditCompany(model);

            CompanyModel company = new CompanyModel();

            company = companyDAL.GetCompanies().Where(x => x.Address == "testAddress" && x.Id == companyId).FirstOrDefault();
            Assert.That(company != null, Is.False);
        }