Example #1
0
        public void PropagatorThrowsWhenRegisteringNullInstance()
        {
            var registry = new InMemoryPropagationRegistry();
            var ex       = Record.Exception(() => registry.Register("http", null));

            Assert.NotNull(ex);
            Assert.IsType <ArgumentNullException>(ex);
        }
Example #2
0
        public void TryGetReturnsRegisteredPropagator()
        {
            var registry = new InMemoryPropagationRegistry();

            registry.Register("text", new B3Propagator());
            Assert.True(registry.TryGet("text", out var prop));
            Assert.NotNull(prop);
            Assert.IsType <B3Propagator>(prop);
        }
Example #3
0
        public void TryGetFailsForUnRegisteredPropagator()
        {
            var registry = new InMemoryPropagationRegistry();

            Assert.False(registry.TryGet("http", out var _));
            Assert.False(registry.TryGet("text", out var _));

            registry.Register("text", new B3Propagator());
            Assert.True(registry.TryGet("text", out var _));
            Assert.False(registry.TryGet("http", out var _));
        }
Example #4
0
        public void RegistrationIsSuccessfulForNonNullInstance()
        {
            var registry = new InMemoryPropagationRegistry();

            registry.Register("http", new B3Propagator());
        }