Exemplo n.º 1
0
        public TrackingsController(IUsersManager usersManager, IDonationsRequestsManager requestsManager)
        {
            Guard.WhenArgument <IUsersManager>(usersManager, "Users manager cannot be null.")
            .IsNull()
            .Throw();
            Guard.WhenArgument <IDonationsRequestsManager>(requestsManager, "Requests manager cannot be null.")
            .IsNull()
            .Throw();

            this.usersManager    = usersManager as IManager;
            this.requestsManager = requestsManager as IManager;
        }
Exemplo n.º 2
0
        public RequestsController(IDonationsRequestsManager requestsManager, IUsersManager usersManager, IDonatorsManager donatorsManager, IDonationsRequestsFactory requestsFactory, IDonatorsFactory donatorsFactory)
        {
            Guard.WhenArgument <IDonationsRequestsManager>(requestsManager, "Requests manager cannot be null.")
            .IsNull()
            .Throw();
            Guard.WhenArgument <IUsersManager>(usersManager, "Users manager cannot be null.")
            .IsNull()
            .Throw();
            Guard.WhenArgument <IDonatorsManager>(donatorsManager, "Donators manager cannot be null.")
            .IsNull()
            .Throw();
            Guard.WhenArgument <IDonationsRequestsFactory>(requestsFactory, "Requests factory cannot be null.")
            .IsNull()
            .Throw();
            Guard.WhenArgument <IDonatorsFactory>(donatorsFactory, "Donators factory cannot be null.")
            .IsNull()
            .Throw();

            this.requestsManager = requestsManager as IManager;
            this.usersManager    = usersManager as IManager;
            this.donatorsManager = donatorsManager as IManager;
            this.requestsFactory = requestsFactory;
            this.donatorsFactory = donatorsFactory;
        }