public void PropagatorThrowsWhenRegisteringNullInstance() { var registry = new InMemoryPropagationRegistry(); var ex = Record.Exception(() => registry.Register("http", null)); Assert.NotNull(ex); Assert.IsType <ArgumentNullException>(ex); }
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); }
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 _)); }
public void RegistrationIsSuccessfulForNonNullInstance() { var registry = new InMemoryPropagationRegistry(); registry.Register("http", new B3Propagator()); }