예제 #1
0
        public void SetUp()
        {
            var snapshotDefinitionService = new SnapshotDefinitionService(Mock <ILog>());

            snapshotDefinitionService.Load(typeof(ThingySnapshotV1), typeof(ThingySnapshotV2), typeof(ThingySnapshot));
            Inject <ISnapshotDefinitionService>(snapshotDefinitionService);
        }
예제 #2
0
        public void SetUp()
        {
            var snapshotDefinitionService = new SnapshotDefinitionService(
                Logger <SnapshotDefinitionService>(),
                Mock <ILoadedVersionedTypes>());

            snapshotDefinitionService.Load(typeof(ThingySnapshotV1), typeof(ThingySnapshotV2), typeof(ThingySnapshot));
            Inject <ISnapshotDefinitionService>(snapshotDefinitionService);
        }
예제 #3
0
        public void SetUp()
        {
            _resolverMock = InjectMock <IResolver>();
            _resolverMock
            .Setup(r => r.Resolve(typeof(ISnapshotUpgrader <ThingySnapshotV1, ThingySnapshotV2>)))
            .Returns(() => new ThingySnapshotV1ToV2Upgrader());
            _resolverMock
            .Setup(r => r.Resolve(typeof(ISnapshotUpgrader <ThingySnapshotV2, ThingySnapshot>)))
            .Returns(() => new ThingySnapshotV2ToV3Upgrader());

            var snapshotDefinitionService = new SnapshotDefinitionService(Mock <ILog>());

            snapshotDefinitionService.Load(typeof(ThingySnapshotV1), typeof(ThingySnapshotV2), typeof(ThingySnapshot));
            Inject <ISnapshotDefinitionService>(snapshotDefinitionService);
        }
예제 #4
0
        public void SetUp()
        {
            _serviceProviderMock = InjectMock <IServiceProvider>();
            _serviceProviderMock
            .Setup(r => r.GetService(typeof(ISnapshotUpgrader <ThingySnapshotV1, ThingySnapshotV2>)))
            .Returns(() => new ThingySnapshotV1ToV2Upgrader());
            _serviceProviderMock
            .Setup(r => r.GetService(typeof(ISnapshotUpgrader <ThingySnapshotV2, ThingySnapshot>)))
            .Returns(() => new ThingySnapshotV2ToV3Upgrader());

            var snapshotDefinitionService = new SnapshotDefinitionService(
                Logger <SnapshotDefinitionService>(),
                Mock <ILoadedVersionedTypes>());

            snapshotDefinitionService.Load(typeof(ThingySnapshotV1), typeof(ThingySnapshotV2), typeof(ThingySnapshot));
            Inject <ISnapshotDefinitionService>(snapshotDefinitionService);
        }