public CustomerManager(
            string userName,
            DataContext db,
            IAuthService authService,
            IMailer mailer,
            ICustomerLogManager customerLogManager)
            : base(userName)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (authService == null)
            {
                throw new ArgumentNullException("authService");
            }

            if (mailer == null)
            {
                throw new ArgumentNullException("mailer");
            }

            if (customerLogManager == null)
            {
                throw new ArgumentNullException("customerLogManager");
            }

            _db                 = db;
            _authService        = authService;
            _mailer             = mailer;
            _customerLogManager = customerLogManager;
        }
Exemplo n.º 2
0
 public CustomerManager(
     string userName,
     DataContext db,
     IAuthService authService,
     IMailer mailer,
     ICustomerLogManager customerLogManager)
     : base(userName)
 {
     _db                 = db;
     _authService        = authService;
     _mailer             = mailer;
     _customerLogManager = customerLogManager;
 }
 public CustomerManager(
     string userName,
     DataContext db,
     IAuthService authService,
     IMailer mailer,
     ICustomerLogManager customerLogManager)
     : base(userName)
 {
     _db = db;
     _authService = authService;
     _mailer = mailer;
     _customerLogManager = customerLogManager;
 }
        public void Ctor(
            DataContext db,
            IAuthService authService,
            IMailer mailer,
            ICustomerLogManager customerLogManager,
            NullSpecimenDescriptor arg,
            IFixture fixture)
        {
            // Setup
            Action act = () => fixture.Create <CustomerManager>();

            // Verify outcome
            var ex = Assert.Throws <TargetInvocationException>(act);

            Assert.IsAssignableFrom(typeof(ArgumentNullException), ex.InnerException);

            var argNullEx = (ArgumentNullException)ex.InnerException;

            Assert.Equal(argNullEx.ParamName, arg.Alias);
        }
        public void Ctor(
            DataContext db,
            IAuthService authService,
            IMailer mailer,
            ICustomerLogManager customerLogManager, 
            NullSpecimenDescriptor arg, 
            IFixture fixture)
        {
            // Setup
            Action act = () => fixture.Create<CustomerManager>();

            // Verify outcome
            var ex = Assert.Throws<TargetInvocationException>(act);
            Assert.IsAssignableFrom(typeof(ArgumentNullException), ex.InnerException);

            var argNullEx = (ArgumentNullException)ex.InnerException;
            Assert.Equal(argNullEx.ParamName, arg.Alias);
        }