Example #1
0
        public void OnParsing_ParamsAreValidForManage_ReturnsSuccessAndSetsManage(params string[] linePieces)
        {
            var configLine = new ManagedBlockConfigLine(linePieces);

            var uut = new ManagedBlockSettingsProvider();

            var settings = uut.Settings;

            settings.Manage = true;

            var result = uut.OnParsing(configLine);

            result.IsSuccess.ShouldBeTrue();

            uut.Settings.ShouldBe(settings);
        }
Example #2
0
        public void OnParsing_OptionIsUnknown_ReturnsIgnoredAndSetsManage(params string[] linePieces)
        {
            var configLine = new ManagedBlockConfigLine(linePieces);

            var uut = new ManagedBlockSettingsProvider();

            var settings = uut.Settings;

            settings.Manage = true;

            var result = uut.OnParsing(configLine);

            result.IsIgnored.ShouldBeTrue();

            uut.Settings.ShouldBe(settings);
        }
Example #3
0
        public void OnParsing_ParamsAreInvalid_ReturnsErrorAndDoesNotChangeSettings(params string[] linePieces)
        {
            var configLine = new ManagedBlockConfigLine(linePieces);

            var uut = new ManagedBlockSettingsProvider();

            var settings = uut.Settings;

            var result = uut.OnParsing(configLine);

            result.IsError.ShouldBeTrue();
            if (linePieces.Length >= 2)
            {
                result.Error.ShouldContain(linePieces[1]);
            }

            uut.Settings.ShouldBe(settings);
        }