Exemple #1
0
        public UpgradeAsyncTests()
        {
            logger         = A.Fake <ILogger <MigrationRunner> >();
            container      = A.Fake <IRapidContainerAdapter>();
            environment    = A.Fake <IMigrationEnvironment>();
            appLocker      = A.Fake <IDistributedAppLockProvider>();
            contextFactory = A.Fake <IMigrationContextFactory>();
            finder         = A.Fake <IMigrationFinder>();
            storage        = A.Fake <IMigrationStorage>();
            context        = A.Fake <IMigrationContext>();
            appLock        = A.Fake <IDistributedAppLock>();
            migration1     = A.Fake <IMigration>();
            migration2     = A.Fake <IMigration>();

            A.CallTo(() => appLocker.AcquireAsync("RapidCoreMigrations", A <TimeSpan> ._, A <TimeSpan> ._))
            .Returns(Task.FromResult(appLock));
            A.CallTo(() => contextFactory.GetContext()).Returns(context);

            runner = new MigrationRunner(
                logger,
                container,
                environment,
                appLocker,
                contextFactory,
                finder,
                storage
                );
        }
Exemple #2
0
        public ReflectionMigrationFinderTests()
        {
            context   = A.Fake <IMigrationContext>();
            container = A.Fake <IRapidContainerAdapter>();
            storage   = A.Fake <IMigrationStorage>();

            A.CallTo(() => context.Container).Returns(container);
            A.CallTo(() => context.Storage).Returns(storage);

            A.CallTo(() => container.Resolve(A <Type> ._)).Returns(null);

            finder = new ReflectionMigrationFinder(typeof(ReflectionMigrationFinderTests).GetTypeInfo().Assembly);
        }
Exemple #3
0
 public MigrationRunner(
     ILogger <MigrationRunner> logger,
     IRapidContainerAdapter container,
     IMigrationEnvironment environment,
     IDistributedAppLockProvider appLocker,
     IMigrationContextFactory contextFactory,
     IMigrationFinder finder,
     IMigrationStorage storage
     )
 {
     this.logger         = logger;
     this.container      = container;
     this.environment    = environment;
     this.appLocker      = appLocker;
     this.contextFactory = contextFactory;
     this.finder         = finder;
     this.storage        = storage;
 }
Exemple #4
0
 public AuditDiffer(IRapidContainerAdapter container)
 {
     this.container    = container;
     stateChangeFinder = new StateChangeFinder();
 }