public SelfEmploymentsController(IMapService mapService, IPagerFactory pagerFactory, ISelfEmploymentService selfService) : base(mapService, pagerFactory) { Guard.WhenArgument <ISelfEmploymentService>(selfService, "selfService").IsNull().Throw(); this.selfService = selfService; }
public void ThrowArgumentNullException_WhenselfEmploymentServiceIsNull() { // Arrange var mapService = new Mock <IMapService>(); var employeeService = new Mock <IEmployeeService>(); ISelfEmploymentService selfEmploymentService = null; var payrollCalculations = new Mock <Payroll>(); // Act & Assert Assert.Throws <ArgumentNullException>(() => new FreelanceContractController(mapService.Object, employeeService.Object, selfEmploymentService, payrollCalculations.Object)); }
public FreelanceContractController(IMapService mapService, IEmployeeService employeeService, ISelfEmploymentService selfEmploymentService, Payroll calculate) { Guard.WhenArgument(mapService, "mapService").IsNull().Throw(); Guard.WhenArgument(employeeService, "employeeService").IsNull().Throw(); Guard.WhenArgument(selfEmploymentService, "selfEmploymentService").IsNull().Throw(); Guard.WhenArgument(calculate, "calculate").IsNull().Throw(); this.mapService = mapService; this.employeeService = employeeService; this.selfEmploymentService = selfEmploymentService; this.calculate = calculate; }
public void ThrowArgumentNullException_WhenSelfEmploymentServiceIsNull() { // Arrange var cacheService = new Mock <ICacheService>(); var userService = new Mock <IUserService>(); var paycheckService = new Mock <IEmployeePaycheckService>(); var billService = new Mock <IRemunerationBillService>(); ISelfEmploymentService selfEmploymentService = null; // Act & Assert Assert.Throws <ArgumentNullException>(() => new HomeController(cacheService.Object, userService.Object, paycheckService.Object, billService.Object, selfEmploymentService)); }
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; }