Exemplo n.º 1
0
        public void Fix_1845_EndpointRegistry_should_override_ReadOnly_endpoint()
        {
            var reg      = new EndpointRegistry();
            var endpoint = TestActor;

            reg.RegisterReadOnlyEndpoint(address1, endpoint, 1);
            reg.RegisterReadOnlyEndpoint(address1, endpoint, 2);

            var ep = reg.ReadOnlyEndpointFor(address1);

            ep.Item1.ShouldBe(endpoint);
            ep.Item2.ShouldBe(2);
        }
Exemplo n.º 2
0
        public void EndpointRegistry_must_remove_readonly_endpoints_if_marked_as_failed()
        {
            var reg = new EndpointRegistry();

            reg.RegisterReadOnlyEndpoint(address1, actorA);
            reg.MarkAsFailed(actorA, Deadline.Now);
            Assert.Null(reg.ReadOnlyEndpointFor(address1));
        }
Exemplo n.º 3
0
        public void EndpointRegistry_must_be_able_to_register_a_readonly_endpoint()
        {
            var reg = new EndpointRegistry();
            Assert.Null(reg.ReadOnlyEndpointFor(address1));

            Assert.Equal(actorA, reg.RegisterReadOnlyEndpoint(address1, actorA));
            Assert.Equal(actorA, reg.ReadOnlyEndpointFor(address1));
            Assert.Null(reg.WritableEndpointWithPolicyFor(address1));
            Assert.False(reg.IsWritable(actorA));
            Assert.True(reg.IsReadOnly(actorA));
            Assert.False(reg.IsQuarantined(address1, 42));
        }
Exemplo n.º 4
0
        public void EndpointRegistry_must_be_able_to_register_a_readonly_endpoint()
        {
            var reg = new EndpointRegistry();

            Assert.Null(reg.ReadOnlyEndpointFor(address1));

            Assert.Equal(actorA, reg.RegisterReadOnlyEndpoint(address1, actorA));
            Assert.Equal(actorA, reg.ReadOnlyEndpointFor(address1));
            Assert.Null(reg.WritableEndpointWithPolicyFor(address1));
            Assert.False(reg.IsWritable(actorA));
            Assert.True(reg.IsReadOnly(actorA));
            Assert.False(reg.IsQuarantined(address1, 42));
        }
Exemplo n.º 5
0
        public void EndpointRegistry_must_be_able_to_register_writable_and_readonly_endpoint_correctly()
        {
            var reg = new EndpointRegistry();
            Assert.Null(reg.ReadOnlyEndpointFor(address1));
            Assert.Null(reg.WritableEndpointWithPolicyFor(address1));

            Assert.Equal(actorA, reg.RegisterReadOnlyEndpoint(address1, actorA));
            Assert.Equal(actorB, reg.RegisterWritableEndpoint(address1, actorB));

            Assert.Equal(actorA, reg.ReadOnlyEndpointFor(address1));
            Assert.Equal(actorB, reg.WritableEndpointWithPolicyFor(address1).AsInstanceOf<EndpointManager.Pass>().Endpoint);

            Assert.False(reg.IsWritable(actorA));
            Assert.True(reg.IsWritable(actorB));

            Assert.True(reg.IsReadOnly(actorA));
            Assert.False(reg.IsReadOnly(actorB));
        }
Exemplo n.º 6
0
        public void EndpointRegistry_must_be_able_to_register_writable_and_readonly_endpoint_correctly()
        {
            var reg = new EndpointRegistry();

            Assert.Null(reg.ReadOnlyEndpointFor(address1));
            Assert.Null(reg.WritableEndpointWithPolicyFor(address1));

            Assert.Equal(actorA, reg.RegisterReadOnlyEndpoint(address1, actorA));
            Assert.Equal(actorB, reg.RegisterWritableEndpoint(address1, actorB));

            Assert.Equal(actorA, reg.ReadOnlyEndpointFor(address1));
            Assert.Equal(actorB, reg.WritableEndpointWithPolicyFor(address1).AsInstanceOf <EndpointManager.Pass>().Endpoint);

            Assert.False(reg.IsWritable(actorA));
            Assert.True(reg.IsWritable(actorB));

            Assert.True(reg.IsReadOnly(actorA));
            Assert.False(reg.IsReadOnly(actorB));
        }
Exemplo n.º 7
0
 public void EndpointRegistry_must_remove_readonly_endpoints_if_marked_as_failed()
 {
     var reg = new EndpointRegistry();
     reg.RegisterReadOnlyEndpoint(address1, actorA);
     reg.MarkAsFailed(actorA, Deadline.Now);
     Assert.Null(reg.ReadOnlyEndpointFor(address1));
 }
Exemplo n.º 8
0
        public void Fix_1845_EndpointRegistry_should_override_ReadOnly_endpoint()
        {
            var reg = new EndpointRegistry();
            var endpoint = TestActor;
            reg.RegisterReadOnlyEndpoint(address1, endpoint, 1);
            reg.RegisterReadOnlyEndpoint(address1, endpoint, 2);

            var ep = reg.ReadOnlyEndpointFor(address1);
            ep.Item1.ShouldBe(endpoint);
            ep.Item2.ShouldBe(2);
        }