示例#1
0
        private MaxWHConfirmDataUtil DataUtil(MaxWHConfirmFacade facade, SalesDbContext dbContext)
        {
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            var maxWHConfirmFacade   = new MaxWHConfirmFacade(serviceProvider, dbContext);
            var maxWHConfirmDataUtil = new MaxWHConfirmDataUtil(maxWHConfirmFacade);

            return(maxWHConfirmDataUtil);
        }
示例#2
0
        public async void DeleteAsync_NotImplementedException()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            MaxWHConfirmFacade facade = new MaxWHConfirmFacade(serviceProvider, dbContext);

            var data = await DataUtil(facade, dbContext).GetTestData();

            //Assert
            await Assert.ThrowsAsync <NotImplementedException>(() => facade.DeleteAsync((int)data.Id));
        }
示例#3
0
        public virtual async void Create_Success()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            MaxWHConfirmFacade facade = new MaxWHConfirmFacade(serviceProvider, dbContext);

            var data = await DataUtil(facade, dbContext).GetNewData();

            var response = await facade.CreateAsync(data);

            Assert.NotEqual(response, 0);
        }
示例#4
0
        public virtual async void Get_By_Id_Success()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            MaxWHConfirmFacade facade = Activator.CreateInstance(typeof(MaxWHConfirmFacade), serviceProvider, dbContext) as MaxWHConfirmFacade;

            var data = await DataUtil(facade, dbContext).GetTestData();

            var Response = facade.ReadByIdAsync((int)data.Id);

            Assert.NotEqual(Response.Id, 0);
        }
示例#5
0
        public virtual async void Get_All_Success()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            MaxWHConfirmFacade facade = Activator.CreateInstance(typeof(MaxWHConfirmFacade), serviceProvider, dbContext) as MaxWHConfirmFacade;

            var data = await DataUtil(facade, dbContext).GetTestData();

            var Response = facade.Read(1, 25, "{}", new List <string>(), "", "{}");

            Assert.NotEqual(Response.Data.Count, 0);
        }
示例#6
0
        public void Should_Success_Validate_Data()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            MaxWHConfirmFacade facade = new MaxWHConfirmFacade(serviceProvider, dbContext);

            var data = DataUtil(facade, dbContext).GetNewData();
            MaxWHConfirmViewModel nullViewModel = new MaxWHConfirmViewModel();

            Assert.True(nullViewModel.Validate(null).Count() > 0);

            MaxWHConfirmViewModel vm = new MaxWHConfirmViewModel
            {
                UnitMaxValue = -2,
                SKMaxValue   = -2
            };

            Assert.True(vm.Validate(null).Count() > 0);
        }
        private GarmentSewingBlockingPlanDataUtil DataUtil(GarmentSewingBlockingPlanFacade facade, SalesDbContext dbContext)
        {
            var serviceProvider       = GetServiceProviderMock(dbContext).Object;
            var WeekserviceProvider   = GetWeekServiceProviderMock(dbContext).Object;
            var BOserviceProvider     = GetBOServiceProviderMock(dbContext).Object;
            var WHServiceProviderMock = GetWHServiceProviderMock(dbContext).Object;

            var weeklyPlanFacade   = new WeeklyPlanFacade(WeekserviceProvider, dbContext);
            var weeklyPlanDataUtil = new WeeklyPlanDataUtil(weeklyPlanFacade);

            var bookingOrderFacade          = new GarmentBookingOrderFacade(BOserviceProvider, dbContext);
            var garmentBookingOrderDataUtil = new GarmentBookingOrderDataUtil(bookingOrderFacade);

            var maxWHConfirmFacade   = new MaxWHConfirmFacade(WHServiceProviderMock, dbContext);
            var maxWHConfirmDataUtil = new MaxWHConfirmDataUtil(maxWHConfirmFacade);

            var garmentSewingBlockingPlanFacade   = new GarmentSewingBlockingPlanFacade(serviceProvider, dbContext);
            var garmentSewingBlockingPlanDataUtil = new GarmentSewingBlockingPlanDataUtil(garmentSewingBlockingPlanFacade, weeklyPlanDataUtil, garmentBookingOrderDataUtil, maxWHConfirmDataUtil);



            return(garmentSewingBlockingPlanDataUtil);
        }