Пример #1
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);
        }
Пример #2
0
        public void TestDeleteProfile()
        {
            ApplicationSeeder.Seed();

            var bo = new ProfileBO();

            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));
        }
Пример #3
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");
        }
Пример #4
0
        public void TestUpdateClientAsync()
        {
            ApplicationSeeder.Seed();

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

            var resList = bo.ListAsync().Result;

            var item = resList.Result.FirstOrDefault();

            item.ProfileId = 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().ProfileId == foreignBO.ListUndeleted().Result.Last().Id);
        }