public CustomerManager( string userName, DataContext db, IAuthService authService, IMailer mailer, ICustomerLogManager customerLogManager) : base(userName) { _db = db; _authService = authService; _mailer = mailer; _customerLogManager = customerLogManager; }
public void Customize(IFixture fixture) { var loader = new EntityObjectDataLoader(conf => conf .Add<CountriesDataLoader>() .Add<AddressesDataLoader>() .Add<CustomersDataLoader>()); var connection = Effort.DbConnectionFactory.CreateTransient(loader); var db = new DataContext(connection); fixture.Register(() => db); }
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); }