public List <ClientDAO> GetClients() { var s = new List <ClientDAO>(); foreach (var client in ef.GetClients()) { s.Add(ClientMapper.MapToClientDAO(client)); } return(s); }
public void Test_AddJob() { var data = new EfData(); var client = data.GetClients().Where(c => c.Id == 4).FirstOrDefault(); var user = data.GetUsers().Where(c => c.Id == "60d9002e-667f-4794-a9dd-670c0ecf56c9").FirstOrDefault(); var st = data.GetTypes().Where(c => c.Id == 1).FirstOrDefault(); var expected = new ScheduleJob { ServiceType = st, Client = client, UserID = user.Id, }; var actual = data.AddJob(expected); Assert.True(actual); }
public void Test_insertJob() { var data = new EfData(); var client = data.GetClients().Where(c => c.Id == 4).FirstOrDefault(); var user = data.GetUsers().Where(c => c.Id == "60d9002e-667f-4794-a9dd-670c0ecf56c9").FirstOrDefault(); var st = data.GetTypes().Where(c => c.Id == 1).FirstOrDefault(); var client2 = ClientMapper.MapToClientDAO(client); var user2 = UserMapper.MapToUserDAO(user); var st2 = ServiceTypeMapper.MapToServiceTypeDAO(st); var j = new JobDAO(); j.Client = client2; j.User = user2; j.ServiceType = st2; var actual = AddJob(j); Assert.True(actual); }