public void TestTypeSafeConstructorDefinitionThrowsWithPropertyExpression() { const string actorName = "test-actor"; var actor = new TestInterfaceActor(); var message = Assert.Throws <ArgumentException>(() => Definition.Has(() => actor.IsStopped, actorName)).Message; Assert.Equal($"The create function must be a 'new T (parameters)' expression", message); }
public void TestDirectoryAlreadyRegistered() { var directory = new Directory(new BasicAddress(0, "")); var address = World.AddressFactory.UniqueWith("test-actor"); var actor = new TestInterfaceActor(); directory.Register(address, actor); Assert.Throws <InvalidOperationException>(() => directory.Register(address, new TestInterfaceActor())); }
public void TestDirectoryRegister() { var directory = new Directory(new BasicAddress(0, "")); var address = World.AddressFactory.UniqueWith("test-actor"); var actor = new TestInterfaceActor(); directory.Register(address, actor); Assert.True(directory.IsRegistered(address)); Assert.False(directory.IsRegistered(World.AddressFactory.UniqueWith("another-actor"))); }