public void Should_not_be_null_when_set(CastleConfiguration configuration) { CastleConfiguration.SetConfiguration(configuration); var result = CastleConfiguration.Configuration; result.Should().NotBe(null); }
public void Should_get_default_from_http_request(HttpRequest request, CastleConfiguration cfg) { CastleConfiguration.SetConfiguration(cfg); var result = Context.FromHttpRequest(request); result.Should().NotBe(null); }
public void Should_be_able_to_set_trustedproxies(CastleConfiguration configuration, string[] trustedProxies) { configuration.TrustedProxies = trustedProxies; CastleConfiguration.SetConfiguration(configuration); var result = configuration.TrustedProxies; result.Should().BeEquivalentTo(trustedProxies); }
public void Should_be_able_to_set_denylist(CastleConfiguration configuration, string[] denyList) { configuration.DenyList = denyList; CastleConfiguration.SetConfiguration(configuration); var result = configuration.DenyList; result.Should().BeEquivalentTo(denyList); }
public void Should_be_able_to_set_baseurl(CastleConfiguration configuration, string baseUrl) { configuration.BaseUrl = baseUrl; CastleConfiguration.SetConfiguration(configuration); var result = configuration.BaseUrl; result.Should().Be(baseUrl); }
public void Should_be_able_to_set_timeout(CastleConfiguration configuration, int timeout) { configuration.Timeout = timeout; CastleConfiguration.SetConfiguration(configuration); var result = configuration.Timeout; result.Should().Be(timeout); }
public void Should_be_able_to_set_loglevel(CastleConfiguration configuration) { configuration.LogLevel = LogLevel.None; CastleConfiguration.SetConfiguration(configuration); var result = configuration.LogLevel; result.Should().Be(LogLevel.None); }
/// <exception cref="ArgumentException">Thrown when <paramref name="configuration"/> is null</exception> public CastleClient(CastleConfiguration configuration) { ArgumentGuard.NotNull(configuration, nameof(configuration)); _configuration = configuration; CastleConfiguration.SetConfiguration(configuration); _logger = new LoggerWithLevels(configuration.Logger, configuration.LogLevel); _messageSender = MessageSenderFactory.Create(configuration, _logger); }