private void PrepareForRemoving(String Login)
 {
     PublicUserInfo userInfo = new PublicUserInfo() { Login = "Employee" };
     User user = new User() { PublicUserInfo = userInfo };
     Project project = new Project() { Manager = userInfo };
     EmployeeDescription employeeDescription = new EmployeeDescription() { Employee = userInfo, Project = project };
     Contract contract = new Contract() { Creator = userInfo, Employee = userInfo, Project = project };
     WorkRecord record = new WorkRecord { EmployeeDescription = employeeDescription, MinutesWorked = 12 };
     Summary summary = new Summary { EmployeeDescription = employeeDescription };
     Dao.SetUser(user);
     Assert.IsFalse(Dao.GetEmployeeDescriptions(user).Count > 0);
     Assert.IsFalse(Dao.GetRecords(user).Count > 0);
     Assert.IsFalse(Dao.GetSummaries(user).Count > 0);
     Assert.IsFalse(Dao.GetContracts(user).Count > 0);
     Dao.SetProject(project);
     Dao.SetEmployeeDescription(employeeDescription);
     Dao.SetRecord(record);
     Dao.SetSummary(summary);
     Dao.SetContract(contract);
     Assert.IsTrue(Dao.GetEmployeeDescriptions(user).Count > 0);
     Assert.IsTrue(Dao.GetRecords(user).Count > 0);
     Assert.IsTrue(Dao.GetContracts(user).Count > 0);
     Assert.IsTrue(Dao.GetSummaries(user).Count > 0);
 }
 public IList<Contract> GetContractOfManagerWithUser(PublicUserInfo employee)
 {
     EnsureManager();
     return ((IManagerPanelDAO)_db).GetContractsOfManager(((IManagerPanelDAO) _db).GetUser(employee.Login));
 }
 public void RemovedRecordIsRemovedPermanently()
 {
     PublicUserInfo userInfo = new PublicUserInfo() { Login = "Worker" };
     Project project = new Project() { Manager = userInfo };
     EmployeeDescription employeeDescription = new EmployeeDescription() { Employee = userInfo, Project = project };
     WorkRecord workRecord = new WorkRecord() { EmployeeDescription = employeeDescription };
     User user = new User() { PublicUserInfo = userInfo };
     Dao.SetUser(user);
     Dao.SetProject(project);
     Dao.SetEmployeeDescription(employeeDescription);
     Dao.SetRecord(workRecord);
     Assert.IsTrue(Dao.GetRecordsOfEmployee(employeeDescription).Count > 0);
     Dao.RemoveRecord(workRecord);
     Assert.IsFalse(Dao.GetRecordsOfEmployee(employeeDescription).Count > 0);
 }