public TripCalculationService( IDataContext context, ILogger <IBaseService> logger, IConfigurationService config, IUserService userService, IDayOfWorkService dayOfWorkService, ITripService tripService) : base(context, logger) { _userService = userService; _dayOfWorkService = dayOfWorkService; _tripService = tripService; _maxWeight = config.GatValueInSection <int>("Calculation", "MaxWeight"); }
public TripCalculationServiceTest() { user = new Mock <AppUser>().Object; tripService = new Mock <ITripService>().Object; var mockUserService = new Mock <IUserService>(); mockUserService.Setup(us => us.GetUserByIdentityNumber(It.IsAny <string>())).Returns(user); userService = mockUserService.Object; dowService = new Mock <IDayOfWorkService>().Object; var logger = new Mock <ILogger <IBaseService> >().Object; var mockConfig = new Mock <IConfigurationService>(); mockConfig.Setup(mc => mc.GatValueInSection <int>(It.IsAny <string>(), It.IsAny <string>())).Returns(maxWeight); var config = mockConfig.Object; var dataContext = new Mock <IDataContext>().Object; calculationService = new TripCalculationService(dataContext, logger, config, userService, dowService, tripService); }