示例#1
0
        public void TestListBrandAsync()
        {
            ContextSeeder.Seed();
            var bo      = new BrandBusinessObject();
            var resList = bo.ListAsync().Result;

            Assert.IsTrue(resList.Success && resList.Result.Count == 1);
        }
示例#2
0
        public void TestCreateSameNameBrandAsync()
        {
            ContextSeeder.Seed();
            var bo        = new BrandBusinessObject();
            var item      = bo.ListAsync().Result.Result.FirstOrDefault();
            var reg       = new Brand(item.Name);
            var resCreate = bo.CreateAsync(reg).Result;

            Assert.IsTrue(!resCreate.Result);
        }
示例#3
0
        public void TestDeleteBrandAsync()
        {
            ContextSeeder.Seed();
            var bo        = new BrandBusinessObject();
            var resList   = bo.ListAsync().Result;
            var resDelete = bo.DeleteAsync(resList.Result.First().Id).Result;

            resList = bo.ListNotDeletedAsync().Result;
            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == 0);
        }
示例#4
0
        public void TestUpdateBrandAsync()
        {
            ContextSeeder.Seed();
            var bo      = new BrandBusinessObject();
            var resList = bo.ListAsync().Result;
            var item    = resList.Result.FirstOrDefault();

            item.Name = "It's just wine";
            var resUpdate = bo.UpdateAsync(item).Result;

            resList = bo.ListNotDeletedAsync().Result;
            Assert.IsTrue(resList.Success && resUpdate.Success && resList.Result.First().Name == "It's just wine");
        }