예제 #1
0
        public void SetActorProxyFactoryDefaultOptions_ToNull_ThrowsArgumentNullException()
        {
            var    factory = new ActorProxyFactory();
            Action action  = () => factory.DefaultOptions = null;

            action.Should().Throw <ArgumentNullException>();
        }
예제 #2
0
        public void CreateGeneric_WithCustomSerializerOnDefaultActorProxyFactory_Succeeds()
        {
            var factory = new ActorProxyFactory();

            factory.DefaultOptions.JsonSerializerOptions = new JsonSerializerOptions();

            var actorId = new ActorId("abc");
            var proxy   = (ActorProxy)factory.CreateActorProxy <ITestActor>(actorId, "TestActor");

            Assert.Same(factory.DefaultOptions.JsonSerializerOptions, proxy.JsonSerializerOptions);
        }
예제 #3
0
        public void Create_WithCustomSerializerOnDefaultActorProxyFactory_Succeeds()
        {
            var factory = new ActorProxyFactory();

            factory.DefaultOptions.JsonSerializerOptions = new JsonSerializerOptions();
            ActorProxy.DefaultProxyFactory = factory;

            var actorId = new ActorId("abc");
            var proxy   = (ActorProxy)ActorProxy.Create(actorId, typeof(ITestActor), "TestActor");

            Assert.Same(factory.DefaultOptions.JsonSerializerOptions, proxy.JsonSerializerOptions);
        }