public void SetActorProxyFactoryDefaultOptions_ToNull_ThrowsArgumentNullException() { var factory = new ActorProxyFactory(); Action action = () => factory.DefaultOptions = null; action.Should().Throw <ArgumentNullException>(); }
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); }
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); }