Example #1
0
        public HomeController(IHomeControllerWorkerServices workerService)
        {
            Contract.Requires <ArgumentNullException>(workerService != null, "workerService");
            Contract.Ensures(this.WorkerService == workerService);

            this.WorkerService = workerService;
        }
Example #2
0
        public HomeController(IHomeControllerWorkerServices svc)
        {
            Contract.Requires <ArgumentNullException>(svc != null, "svc");
            Contract.Ensures(this.WorkerService == svc);

            this.WorkerService = svc;
        }
Example #3
0
        public void HomeController_Constructor_should_Throw_on_null_WorkerService()
        {
            IHomeControllerWorkerServices svc = null;

            Executing.This(
                () => new HomeController(svc)
                ).
            Should().
            Throw <ArgumentNullException>().
            And.
            ValueOf.
            ParamName.
            Should().
            Be("workerService");
        }