public void TestCreateAndListCommentAsync() { ApplicationSeeder.Seed(); var bo = new CommentBO(); var foreignBO = new ClientBO(); var comment = new Comment("Tou só a testar", foreignBO.ListUndeleted().Result.First().Id); var resCreate = bo.CreateAsync(comment).Result; var resGet = bo.ReadAsync(comment.Id).Result; Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }
public void TestDeleteClient() { ApplicationSeeder.Seed(); var bo = new ClientBO(); var resList = bo.List(); var total = resList.Result.Count; var resDelete = bo.Delete(resList.Result.First().Id); var list = bo.ListUndeleted(); Assert.IsTrue(resDelete.Success && resList.Success && list.Result.Count == (total - 1)); }
public void TestUpdateClient() { ApplicationSeeder.Seed(); var bo = new ClientBO(); var foreignBO = new ProfileBO(); var resList = bo.List(); var item = resList.Result.FirstOrDefault(); item.ProfileId = foreignBO.ListUndeleted().Result.Last().Id; var resUpdate = bo.Update(item); var list = bo.ListUndeleted(); Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().ProfileId == foreignBO.ListUndeleted().Result.Last().Id); }
public void TestCreateAndListJobAsync() { ApplicationSeeder.Seed(); var bo = new JobBO(); var foreignBO = new ServiceBO(); var foreignClientBO = new ClientBO(); var job = new Job("Setúbal N4 1323", DateTime.Now.Date.AddDays(2), DateTime.Now.Date.AddDays(2).AddMinutes(180), 23.99, "Scheduled", 0, false, foreignBO.ListUndeleted().Result.First().Id, foreignClientBO.ListUndeleted().Result.First().Id); var resCreate = bo.CreateAsync(job).Result; var resGet = bo.ReadAsync(job.Id).Result; Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }