Exemple #1
0
        public async Task CreateAsync_CallsConstructor()
        {
            var activator = new DefaultActorActivator();

            var host  = new ActorHost(ActorTypeInformation.Get(typeof(TestActor)), ActorId.CreateRandom(), JsonSerializerDefaults.Web, NullLoggerFactory.Instance, ActorProxy.DefaultProxyFactory);
            var state = await activator.CreateAsync(host);

            Assert.IsType <TestActor>(state.Actor);
        }
Exemple #2
0
        public async Task CreateAsync_CallsConstructor()
        {
            var activator = new DefaultActorActivator();

            var host  = ActorHost.CreateForTest <TestActor>();
            var state = await activator.CreateAsync(host);

            Assert.IsType <TestActor>(state.Actor);
        }
Exemple #3
0
        public async Task DeleteAsync_NotDisposable()
        {
            var activator = new DefaultActorActivator();

            var host  = new ActorHost(ActorTypeInformation.Get(typeof(TestActor)), ActorId.CreateRandom(), JsonSerializerDefaults.Web, NullLoggerFactory.Instance, ActorProxy.DefaultProxyFactory);
            var actor = new TestActor(host);
            var state = new ActorActivatorState(actor);

            await activator.DeleteAsync(state); // does not throw
        }
Exemple #4
0
        public async Task DeleteAsync_NotDisposable()
        {
            var activator = new DefaultActorActivator();

            var host  = ActorHost.CreateForTest <TestActor>();
            var actor = new TestActor(host);
            var state = new ActorActivatorState(actor);

            await activator.DeleteAsync(state); // does not throw
        }
Exemple #5
0
        public async Task DeleteAsync_AsyncDisposable()
        {
            var activator = new DefaultActorActivator();

            var host  = new ActorHost(ActorTypeInformation.Get(typeof(AsyncDisposableActor)), ActorId.CreateRandom(), JsonSerializerDefaults.Web, NullLoggerFactory.Instance, ActorProxy.DefaultProxyFactory);
            var actor = new AsyncDisposableActor(host);
            var state = new ActorActivatorState(actor);

            await activator.DeleteAsync(state);

            Assert.True(actor.IsDisposed);
        }
Exemple #6
0
        public async Task DeleteAsync_Disposable()
        {
            var activator = new DefaultActorActivator();

            var host  = new ActorHost(ActorTypeInformation.Get(typeof(DisposableActor)), ActorId.CreateRandom(), NullLoggerFactory.Instance);
            var actor = new DisposableActor(host);
            var state = new ActorActivatorState(actor);

            await activator.DeleteAsync(state); // does not throw

            Assert.True(actor.IsDisposed);
        }
Exemple #7
0
        public async Task DeleteAsync_AsyncDisposable()
        {
            var activator = new DefaultActorActivator();

            var host  = ActorHost.CreateForTest <AsyncDisposableActor>();
            var actor = new AsyncDisposableActor(host);
            var state = new ActorActivatorState(actor);

            await activator.DeleteAsync(state);

            Assert.True(actor.IsDisposed);
        }