示例#1
0
        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);
        }
示例#2
0
        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()));
        }
示例#3
0
        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")));
        }