Esempio n. 1
0
 public void Seeding_in_memory_database_does_not_throw()
 {
     Assert.DoesNotThrow(() =>
     {
         _seeder.Seed();
     });
 }
Esempio n. 2
0
        public void TestListProposal()
        {
            ApplicationSeeder.Seed();

            var bo = new ProposalBO();

            var resList = bo.List();

            Assert.IsTrue(resList.Success && resList.Result.Count > 0);
        }
        public void TestListServiceProvidedAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new ServiceProvidedBO();

            var resList = bo.ListAsync().Result;

            Assert.IsTrue(resList.Success && resList.Result.Count > 0);
        }
Esempio n. 4
0
        public void TestListJobAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new JobBO();

            var resList = bo.ListAsync().Result;

            Assert.IsTrue(resList.Success && resList.Result.Count > 0);
        }
Esempio n. 5
0
        public void TestCreateAndListService()
        {
            ApplicationSeeder.Seed();

            var bo      = new ServiceBO();
            var service = new Service("Moving property", "Transporting property/belongings", true);

            var resCreate = bo.Create(service);
            var resGet    = bo.Read(service.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
Esempio n. 6
0
        public void TestCreateAndListProfile()
        {
            ApplicationSeeder.Seed();

            var bo      = new ProfileBO();
            var profile = new Profile("John Doe", "Portugal", DateTime.Now);

            var resCreate = bo.Create(profile);
            var resGet    = bo.Read(profile.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
Esempio n. 7
0
        public void TestCreateAndListClientAsync()
        {
            ApplicationSeeder.Seed();

            var bo        = new ClientBO();
            var foreignBO = new ProfileBO();

            var client = new Client(foreignBO.ListUndeleted().Result.First().Id);

            var resCreate = bo.CreateAsync(client).Result;
            var resGet    = bo.ReadAsync(client.Id).Result;

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
Esempio n. 8
0
        public void TestCreateAndListProposal()
        {
            ApplicationSeeder.Seed();

            var bo        = new ProposalBO();
            var foreignBO = new JobBO();

            var proposal = new Proposal("User Teste", "Mensagem de teste", foreignBO.ListUndeleted().Result.First().Id);

            var resCreate = bo.Create(proposal);
            var resGet    = bo.Read(proposal.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
        public void TestCreateAndListServiceProvidedAsync()
        {
            ApplicationSeeder.Seed();

            var bo        = new ServiceProvidedBO();
            var foreignBO = new ServiceBO();

            var serviceProvided = new ServiceProvided(foreignBO.ListUndeleted().Result.First().Id);

            var resCreate = bo.CreateAsync(serviceProvided).Result;
            var resGet    = bo.ReadAsync(serviceProvided.Id).Result;

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
Esempio n. 10
0
        public void TestCreateAndListComment()
        {
            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.Create(comment);
            var resGet    = bo.Read(comment.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }
        public void TestDeleteServiceProvidedAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new ServiceProvidedBO();

            var resList = bo.ListAsync().Result;
            var total   = resList.Result.Count;

            var resDelete = bo.Delete(resList.Result.First().Id);

            var list = bo.ListUndeletedAsync().Result;

            Assert.IsTrue(resDelete.Success && resList.Success && list.Result.Count == (total - 1));
        }
Esempio n. 12
0
        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);
        }
Esempio n. 13
0
        public void TestDeleteProposal()
        {
            ApplicationSeeder.Seed();

            var bo = new ProposalBO();

            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));
        }
Esempio n. 14
0
        public void TestUpdateProfile()
        {
            ApplicationSeeder.Seed();

            var bo = new ProfileBO();

            var resList = bo.List();

            var item = resList.Result.FirstOrDefault();

            item.Country = "Spain";

            var resUpdate = bo.Update(item);

            var list = bo.ListUndeleted();

            Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().Country == "Spain");
        }
Esempio n. 15
0
        public void TestUpdateService()
        {
            ApplicationSeeder.Seed();

            var bo = new ServiceBO();

            var resList = bo.List();

            var item = resList.Result.FirstOrDefault();

            item.IsActive = false;

            var resUpdate = bo.Update(item);

            var list = bo.ListUndeleted();

            Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().IsActive == false);
        }
Esempio n. 16
0
        public void TestUpdateProposal()
        {
            ApplicationSeeder.Seed();

            var bo = new ProposalBO();

            var resList = bo.List();

            var item = resList.Result.FirstOrDefault();

            item.Message = "Oi";

            var resUpdate = bo.Update(item);

            var list = bo.ListUndeleted();

            Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().Message == "Oi");
        }
Esempio n. 17
0
        public void TestUpdateCommentAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new CommentBO();

            var resList = bo.ListAsync().Result;

            var item = resList.Result.FirstOrDefault();

            item.Message = "Tou só a editar";

            var resUpdate = bo.UpdateAsync(item).Result;

            var list = bo.ListUndeletedAsync().Result;

            Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().Message == "Tou só a editar");
        }
Esempio n. 18
0
        public void TestUpdateJobAsync()
        {
            ApplicationSeeder.Seed();

            var bo = new JobBO();

            var resList = bo.ListAsync().Result;

            var item = resList.Result.FirstOrDefault();

            item.Status = "On going";

            var resUpdate = bo.UpdateAsync(item).Result;

            var list = bo.ListUndeletedAsync().Result;

            Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().Status == "On going");
        }
        public void TestUpdateServiceProvidedAsync()
        {
            ApplicationSeeder.Seed();

            var bo        = new ServiceProvidedBO();
            var foreignBO = new ServiceBO();

            var resList = bo.ListAsync().Result;

            var item = resList.Result.FirstOrDefault();

            item.ServiceId = foreignBO.ListUndeleted().Result.Last().Id;

            var resUpdate = bo.UpdateAsync(item).Result;

            var list = bo.ListUndeletedAsync().Result;

            Assert.IsTrue(resList.Success && resUpdate.Success && list.Result.First().ServiceId == foreignBO.ListUndeleted().Result.Last().Id);
        }
Esempio n. 20
0
        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);
        }
Esempio n. 21
0
 public void Consume(RegoHeadSeeded message)
 {
     _applicationSeeder.Seed();
 }