public PaychecksController(IMapService mapService, IPagerFactory pagerFactory, IEmployeePaycheckService employeePaycheckService) : base(mapService, pagerFactory) { Guard.WhenArgument <IEmployeePaycheckService>(employeePaycheckService, "employeePaycheckService").IsNull().Throw(); this.employeePaycheckService = employeePaycheckService; }
public ReportsController(IEmployeePaycheckService paycheckService, IRemunerationBillService billService) { Guard.WhenArgument(paycheckService, "paycheckService").IsNull().Throw(); Guard.WhenArgument(billService, "billService").IsNull().Throw(); this.paycheckService = paycheckService; this.billService = billService; }
public void ThrowArgumentNullException_WhenEmployeePaycheckServiceIsNull() { // Arrange IEmployeePaycheckService mockedPaycheckService = null; var mockedBillService = new Mock <IRemunerationBillService>(); // Act & Assert Assert.Throws <ArgumentNullException>(() => new ReportsController(mockedPaycheckService, mockedBillService.Object)); }
public void ThrowArgumentNullException_WhenParameterUserServiceIsNullable() { // Arrange var mockedMapService = new Mock <IMapService>(); IEmployeePaycheckService mockedEmployeePaycheckService = null; var mockedPagerFactory = new Mock <IPagerFactory>(); // Act & Assert Assert.Throws <ArgumentNullException>(() => new PaychecksController(mockedMapService.Object, mockedPagerFactory.Object, mockedEmployeePaycheckService)); }
public void ThrowArgumentNullException_WhenBillServiceIsNull() { // Arrange var mapService = new Mock <IMapService>(); var employeeService = new Mock <IEmployeeService>(); IEmployeePaycheckService paycheckService = null; var payrollCalculations = new Mock <Payroll>(); // Act & Assert Assert.Throws <ArgumentNullException>(() => new LaborContractController(mapService.Object, employeeService.Object, paycheckService, payrollCalculations.Object)); }
public LaborContractController(IMapService mapService, IEmployeeService employeeService, IEmployeePaycheckService employeePaycheckService, Payroll calculate) { Guard.WhenArgument(mapService, "mapService").IsNull().Throw(); Guard.WhenArgument(employeeService, "employeeService").IsNull().Throw(); Guard.WhenArgument(employeePaycheckService, "employeePaycheckService").IsNull().Throw(); Guard.WhenArgument(calculate, "calculate").IsNull().Throw(); this.mapService = mapService; this.employeeService = employeeService; this.employeePaycheckService = employeePaycheckService; this.calculate = calculate; }
public void ThrowArgumentNullException_WhenPaycheckServiceIsNull() { // Arrange var cacheService = new Mock <ICacheService>(); var userService = new Mock <IUserService>(); IEmployeePaycheckService paycheckService = null; var billService = new Mock <IRemunerationBillService>(); var selfEmploymentService = new Mock <ISelfEmploymentService>(); // Act & Assert Assert.Throws <ArgumentNullException>(() => new HomeController(cacheService.Object, userService.Object, paycheckService, billService.Object, 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; }