Esempio n. 1
0
        public InMemoryStateStoreEntryReaderActorTest(ITestOutputHelper output)
        {
            var converter = new Converter(output);

            Console.SetOut(converter);

            var testWorld = TestWorld.StartWithDefaults("test-store");
            var world     = testWorld.World;

            _interest   = new MockStateStoreResultInterest();
            _dispatcher = new MockStateStoreDispatcher <IEntry <string>, TextState>(_interest);

            var stateAdapterProvider = new StateAdapterProvider(world);

            _entryAdapterProvider = new EntryAdapterProvider(world);

            stateAdapterProvider.RegisterAdapter(new Entity1StateAdapter());
            // NOTE: No adapter registered for Entity2.class because it will use the default

            _store = world.ActorFor <IStateStore <IEntry <string> > >(typeof(InMemoryStateStoreActor <TextState, IEntry <string> >), _dispatcher);

            var completes = _store.EntryReader("test");

            _reader = completes.Await();

            StateTypeStateStoreMap.StateTypeToStoreName(typeof(Entity1).FullName, typeof(Entity1));
            StateTypeStateStoreMap.StateTypeToStoreName(typeof(Entity2).FullName, typeof(Entity2));
        }
Esempio n. 2
0
        public InMemoryStateStoreTest(ITestOutputHelper output)
        {
            var converter = new Converter(output);

            Console.SetOut(converter);

            var testWorld = TestWorld.StartWithDefaults("test-store");

            _world = testWorld.World;

            _interest   = new MockStateStoreResultInterest();
            _dispatcher = new MockStateStoreDispatcher <TextEntry, TextState>(_interest);

            var stateAdapterProvider = new StateAdapterProvider(_world);

            new EntryAdapterProvider(_world);

            stateAdapterProvider.RegisterAdapter(new Entity1StateAdapter());
            // NOTE: No adapter registered for Entity2.class because it will use the default

            _store = _world.ActorFor <IStateStore <TextEntry> >(typeof(InMemoryStateStoreActor <TextState, TextEntry>), _dispatcher);

            StateTypeStateStoreMap.StateTypeToStoreName(_storeName1, typeof(Entity1));
            StateTypeStateStoreMap.StateTypeToStoreName(_storeName2, typeof(Entity2));
        }
        public InMemoryStateStoreRedispatchControlTest(ITestOutputHelper output)
        {
            var converter = new Converter(output);

            Console.SetOut(converter);

            _world = World.StartWithDefaults("test-store");

            _interest = new MockStateStoreResultInterest();
            _interest.AfterCompleting <string, Entity1>(0);
            _dispatcher = new MockStateStoreDispatcher <TextState>(_interest);

            var stateAdapterProvider = new StateAdapterProvider(_world);

            new EntryAdapterProvider(_world);

            stateAdapterProvider.RegisterAdapter(new Entity1StateAdapter());
            // NOTE: No adapter registered for Entity2.class because it will use the default

            StateTypeStateStoreMap.StateTypeToStoreName(typeof(Entity1).FullName, typeof(Entity1));

            _store = _world.ActorFor <IStateStore>(typeof(InMemoryStateStoreActor <TextState>), new List <IDispatcher> {
                _dispatcher
            });
        }