示例#1
0
        public void OnParsing_OptionIsUnknown_ReturnsIgnoredAndDoesNotChangeSettings(params string[] linePieces)
        {
            var configLine = new ConfigLine(linePieces);

            var uut = new ProgramSettingsProvider();

            var settings = uut.Settings;

            var result = uut.OnParsing(configLine);

            result.IsIgnored.ShouldBeTrue();

            uut.Settings.ShouldBe(settings);
        }
示例#2
0
        public void OnParsing_ParamsAreInvalid_ReturnsErrorAndDoesNotChangeSettings(params string[] linePieces)
        {
            var configLine = new ConfigLine(linePieces);

            var uut = new ProgramSettingsProvider();

            var settings = uut.Settings;

            var result = uut.OnParsing(configLine);

            result.IsError.ShouldBeTrue();
            result.Error.ShouldContain(configLine.Option);

            uut.Settings.ShouldBe(settings);
        }
示例#3
0
        public void OnParsing_ParamsAreValidForBlockTag_ReturnsSuccessAndSetsBlockTag(params string[] linePieces)
        {
            var configLine = new ConfigLine(linePieces);

            var uut = new ProgramSettingsProvider();

            var settings = uut.Settings;

            settings.ManageInterval = TimeSpan.FromMilliseconds(int.Parse(configLine.GetParam(0)));

            var result = uut.OnParsing(configLine);

            result.IsSuccess.ShouldBeTrue();

            uut.Settings.ShouldBe(settings);
        }