Example #1
0
        public BillsController(IMapService mapService, IPagerFactory pagerFactory, IRemunerationBillService billService)
            : base(mapService, pagerFactory)
        {
            Guard.WhenArgument <IRemunerationBillService>(billService, "billService").IsNull().Throw();

            this.billService = billService;
        }
Example #2
0
        public ReportsController(IEmployeePaycheckService paycheckService, IRemunerationBillService billService)
        {
            Guard.WhenArgument(paycheckService, "paycheckService").IsNull().Throw();
            Guard.WhenArgument(billService, "billService").IsNull().Throw();

            this.paycheckService = paycheckService;
            this.billService     = billService;
        }
Example #3
0
        public void ThrowArgumentNullException_WhenRemunerationBillServiceIsNull()
        {
            // Arrange
            var mockedPaycheckService = new Mock <IEmployeePaycheckService>();
            IRemunerationBillService mockedBillService = null;

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => new ReportsController(mockedPaycheckService.Object, mockedBillService));
        }
Example #4
0
        public void ThrowArgumentNullException_WhenBillServiceIsNull()
        {
            // Arrange
            var mapService      = new Mock <IMapService>();
            var employeeService = new Mock <IEmployeeService>();
            IRemunerationBillService billService = null;
            var payrollCalculations = new Mock <Payroll>();

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => new NonLaborContractController(mapService.Object, employeeService.Object, billService, payrollCalculations.Object));
        }
        public NonLaborContractController(IMapService mapService, IEmployeeService employeeService, IRemunerationBillService remunerationBillService, Payroll calculate)
        {
            Guard.WhenArgument(mapService, "mapService").IsNull().Throw();
            Guard.WhenArgument(employeeService, "employeeService").IsNull().Throw();
            Guard.WhenArgument(remunerationBillService, "employeePaycheckService").IsNull().Throw();
            Guard.WhenArgument(calculate, "calculate").IsNull().Throw();

            this.mapService              = mapService;
            this.employeeService         = employeeService;
            this.remunerationBillService = remunerationBillService;
            this.calculate = calculate;
        }
        public void ThrowArgumentNullException_WhenBillServiceIsNull()
        {
            // Arrange
            var cacheService    = new Mock <ICacheService>();
            var userService     = new Mock <IUserService>();
            var paycheckService = new Mock <IEmployeePaycheckService>();
            IRemunerationBillService billService = null;
            var selfEmploymentService            = new Mock <ISelfEmploymentService>();

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => new HomeController(cacheService.Object, userService.Object, paycheckService.Object, billService, selfEmploymentService.Object));
        }
        public HomeController(ICacheService cacheService, IUserService userService, IEmployeePaycheckService paycheckService, IRemunerationBillService billService, ISelfEmploymentService selfEmploymentService)
        {
            Guard.WhenArgument(cacheService, "cacheService").IsNull().Throw();
            Guard.WhenArgument(userService, "userService").IsNull().Throw();
            Guard.WhenArgument(paycheckService, "paycheckService").IsNull().Throw();
            Guard.WhenArgument(billService, "billService").IsNull().Throw();
            Guard.WhenArgument(selfEmploymentService, "selfEmploymentService").IsNull().Throw();

            this.cacheService          = cacheService;
            this.userService           = userService;
            this.paycheckService       = paycheckService;
            this.billService           = billService;
            this.selfEmploymentService = selfEmploymentService;
        }