Example #1
0
        public void EndpointRegistry_should_not_report_endpoint_as_writable_if_no_Pass_policy()
        {
            var reg      = new EndpointRegistry();
            var deadline = Deadline.Now + TimeSpan.FromMinutes(30);

            Assert.False(reg.IsWritable(TestActor)); // no policy

            reg.RegisterWritableEndpoint(address1, TestActor, 42);
            Assert.True(reg.IsWritable(TestActor));                // pass
            reg.MarkAsFailed(TestActor, deadline);
            Assert.False(reg.IsWritable(TestActor));               // Gated
            reg.RegisterWritableEndpoint(address1, TestActor, 43); // restarted
            Assert.True(reg.IsWritable(TestActor));                // pass
            reg.MarkAsQuarantined(address1, 43, deadline);
            Assert.False(reg.HasWritableEndpointFor(address1));    // Quarantined
        }