Inheritance: Core.Data.DatabaseSettings
        public IntegrationTestRegistry()
        {
            Scan(scanner =>
            {
                scanner.Assembly(typeof(Person).Assembly);
                scanner.AssemblyContainingType<IMediator>();
                scanner.WithDefaultConventions();
                scanner.AddAllTypesOf(typeof(IRequestHandler<,>));
                scanner.AddAllTypesOf(typeof(IAsyncRequestHandler<,>));
                scanner.AddAllTypesOf(typeof(IPostRequestHandler<,>));
                scanner.AddAllTypesOf(typeof(IAsyncPostRequestHandler<,>));
                scanner.AddAllTypesOf(typeof(INotificationHandler<>));
                scanner.AddAllTypesOf(typeof(IAsyncNotificationHandler<>));
            });

            For<ISpecimenBuilder>().Singleton().Use(() => new Fixture());

            var databaseSettings = new IntegrationTestDatabaseSettings();
            For<DatabaseSettings>().Singleton().Use(databaseSettings);
            For<ISessionFactory>().Singleton().Use(new ConfigurationFactory(databaseSettings).GetSessionFactory());
            For<ISession>().Singleton().Use(ctx => ctx.GetInstance<ISessionFactory>().OpenSession());
        }
Exemple #2
0
        public IntegrationTestRegistry()
        {
            Scan(scanner =>
            {
                scanner.Assembly(typeof(Person).Assembly);
                scanner.AssemblyContainingType <IMediator>();
                scanner.WithDefaultConventions();
                scanner.AddAllTypesOf(typeof(IRequestHandler <,>));
                scanner.AddAllTypesOf(typeof(IAsyncRequestHandler <,>));
                scanner.AddAllTypesOf(typeof(IPostRequestHandler <,>));
                scanner.AddAllTypesOf(typeof(IAsyncPostRequestHandler <,>));
                scanner.AddAllTypesOf(typeof(INotificationHandler <>));
                scanner.AddAllTypesOf(typeof(IAsyncNotificationHandler <>));
            });

            For <ISpecimenBuilder>().Singleton().Use(() => new Fixture());

            var databaseSettings = new IntegrationTestDatabaseSettings();

            For <DatabaseSettings>().Singleton().Use(databaseSettings);
            For <ISessionFactory>().Singleton().Use(new ConfigurationFactory(databaseSettings).GetSessionFactory());
            For <ISession>().Singleton().Use(ctx => ctx.GetInstance <ISessionFactory>().OpenSession());
        }