Пример #1
0
        public void TestUpdateStaffTitleAsync()
        {
            ContextSeeders.Seed();

            var boStaffRecord = new StaffRecordBusinessObject();
            var staffRecord   = boStaffRecord.List().Result.First();

            var boTitle = new TitleBusinessObject();
            var title   = boTitle.List().Result.First();

            var mbo     = new StaffTitleBusinessObject();
            var resList = mbo.List();

            var item = resList.Result.FirstOrDefault();

            var newRestaurant = new StaffTitle(staffRecord.Id, title.Id, DateTime.Parse("14/07/2020"), DateTime.Parse("14/07/2021"));

            item.StartDate = newRestaurant.StartDate;
            item.EndDate   = newRestaurant.EndDate;

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

            resList = mbo.ListAsync().Result;

            Assert.IsTrue(resList.Success && resUpdate.Success &&
                          resList.Result.First().StartDate == newRestaurant.StartDate &&
                          resList.Result.First().EndDate == newRestaurant.EndDate);
        }
        public void TestListStaffTitleRecordAsync()
        {
            RestaurantSeeder.SeedCountries();
            var bo      = new StaffTitleBusinessObject();
            var resList = bo.ListAsync().Result;

            Assert.IsTrue(resList.Success && resList.Result.Count == 1);
        }
        public void TestDeleteStaffTitleRecordAsync()
        {
            RestaurantSeeder.SeedCountries();
            var bo        = new StaffTitleBusinessObject();
            var resList   = bo.ListAsync().Result;
            var resDelete = bo.DeleteAsync(resList.Result.First().Id).Result;

            resList = bo.ListUnDeletedAsync().Result;
            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == 0);
        }
        public void TestUpdateStaffTitleRecordAsync()
        {
            RestaurantSeeder.SeedCountries();
            var bo      = new StaffTitleBusinessObject();
            var resList = bo.ListAsync().Result;
            var item    = resList.Result.FirstOrDefault();

            item.StartDate = DateTime.Parse("2014 / 05 / 05");
            var resUpdate = bo.UpdateAsync(item).Result;

            resList = bo.ListUnDeletedAsync().Result;
            Assert.IsTrue(resList.Success && resUpdate.Success && resList.Result.First().StartDate == DateTime.Parse("2014 / 05 / 05"));
        }
Пример #5
0
        public void TestUpdateStaffTitleAsync()
        {
            RestaurantSeeder.Seed();
            var bo      = new StaffTitleBusinessObject();
            var resList = bo.ListAsync().Result;
            var item    = resList.Result.FirstOrDefault();
            var now     = DateTime.Now;

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

            resList = bo.ListNonDeletedAsync().Result;
            Assert.IsTrue(resList.Success && resUpdate.Success && resList.Result.First().BeginDate == now);
        }