public void UpdateListCollegeTest() { List <College> colleges = new List <College>(); College college = new College(); College college2 = new College(); college.Name = "İstanbul Üniversitesi"; college.City = "İstanbul"; college2.Name = "Ege Üniversitesi"; college2.City = "İstanbul"; colleges.Add(college); colleges.Add(college2); CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase()); collegeRepository.Insert(colleges); foreach (var item in colleges) { item.City = "İzmir"; } Assert.IsTrue(collegeRepository.Update(colleges)); }
public void FilterEmployeeTest() { EmployeeRepository employeeRepository = new EmployeeRepository(new VitalityDatabase()); CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase()); Employee employee = new Employee(); College college = new College(); FieldRepository fieldRepository = new FieldRepository(new VitalityDatabase()); Field field = new Field(); field.Name = "Yazılım"; fieldRepository.Insert(field); college.Name = "9 Eylül"; employee.FirstName = "Aybars"; employee.LastName = "Agacabuga"; collegeRepository.Insert(college); employee.CollegeId = college.Id; employee.FieldId = field.Id; employeeRepository.Insert(employee); var fieldList = employeeRepository.GetListByFilter(x => x.College.Name == "9 Eylül").ToList(); // var name = fieldList[0].College.Name; // Assert.IsTrue(name == "9 Eylül"); }
public void InsertEmployeeTest() { CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase()); FieldRepository fieldRepository = new FieldRepository(new VitalityDatabase()); EmployeeRepository employeeRepository = new EmployeeRepository(new Data.Entities.VitalityDatabase()); Employee employee = new Employee(); Field field = new Field(); College college = new College(); field.Name = "Yazılım"; college.Name = "İstanbul Üniversitesi"; employee.FirstName = "Aybars"; employee.LastName = "Agcabuga"; fieldRepository.Insert(field); collegeRepository.Insert(college); employee.FieldId = field.Id; employee.CollegeId = college.Id; Assert.IsTrue(employeeRepository.Insert(employee)); }
public void InsertListCollegeTest() { List <College> colleges = new List <College>(); College college = new College(); college.City = "İstanbul"; college.Name = "İstanbul Üniversitesi"; colleges.Add(college); College college2 = new College(); college2.City = "İzmir"; college2.Name = "Ege Üniversitesi"; colleges.Add(college2); VitalityDatabase vitalityDatabase = new VitalityDatabase(); CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase()); Assert.IsTrue(collegeRepository.Insert(colleges)); }
public void InsertListEmployeeTest() { List <Employee> employees = new List <Employee>(); Employee employee = new Employee(); Field field = new Field(); field.Name = "Computer Science"; College college = new College(); college.Name = "İstanbul Üniversitesi"; FieldRepository fieldRepository = new FieldRepository(new VitalityDatabase()); fieldRepository.Insert(field); CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase()); collegeRepository.Insert(college); employee.FirstName = "Deniz"; employee.LastName = "Doğan"; employee.FieldId = field.Id; employee.CollegeId = college.Id; employees.Add(employee); Employee employee2 = new Employee(); employee2.CollegeId = college.Id; employee2.FieldId = field.Id; employee2.FirstName = "Deniz2"; employee2.LastName = "Doğan2"; employees.Add(employee2); VitalityDatabase vitalityDatabase = new VitalityDatabase(); EmployeeRepository employeeRepository = new EmployeeRepository(vitalityDatabase); Assert.IsTrue(employeeRepository.Insert(employees)); }