private void MinimumLevelNullSetsToMinimum()
        {
            var config = TestOptionsFactory.CreateMemoryConfig("myApp", "http://localhost", "index", null);

            var options = LogstashOptionsReader.Read(config);

            Assert.Equal(0, (int)options.MinimumLevel);               // the levels are changed in RC2, so this test will probably need to be updated
        }
        private void InvalidUriRaisesInvalidOptionException()
        {
            var config = TestOptionsFactory.CreateMemoryConfig("myApp", "abcdefg", "index", LogLevel.Error);

            var ex = Assert.Throws <InvalidOptionException>(() => LogstashOptionsReader.Read(config));

            Assert.Equal(Defaults.ConfigKeys.Url, ex.OptionKey);
            Assert.Equal("abcdefg", ex.OptionValue);
        }
        private void IndexWhitespaceRaisesInvalidOptionException()
        {
            var config = TestOptionsFactory.CreateMemoryConfig("myApp", "http://localhost", "  ", LogLevel.Error);

            var ex = Assert.Throws <InvalidOptionException>(() => LogstashOptionsReader.Read(config));

            Assert.Equal(Defaults.ConfigKeys.Index, ex.OptionKey);
            Assert.Equal("  ", ex.OptionValue);
        }
        private void AppIdNullRaisesInvalidOptionException()
        {
            var config = TestOptionsFactory.CreateMemoryConfig(null, "http://localhost", "index", LogLevel.Error);

            var ex = Assert.Throws <InvalidOptionException>(() => LogstashOptionsReader.Read(config));

            Assert.Equal(Defaults.ConfigKeys.AppId, ex.OptionKey);
            Assert.Equal("(null)", ex.OptionValue);
        }