Ejemplo n.º 1
0
        public void Value_ShouldSetOutputVerbose(string input)
        {
            var outputMock = new Mock <IOutput>();

            outputMock.SetupProperty(o => o.MinimumLevel, LogLevel.Information);

            var sut = new VerbosityOption(outputMock.Object);

            sut.ReceiveValue(input);
            outputMock.Object.MinimumLevel.Should().Be(LogLevel.Debug);
        }
Ejemplo n.º 2
0
        public void NoValue_ShouldNotCHangeOutput()
        {
            var outputMock = new Mock <IOutput>();

            outputMock.SetupProperty(o => o.MinimumLevel, LogLevel.Information);

            var sut = new VerbosityOption(outputMock.Object);

            sut.ReceiveValue(null);
            outputMock.Object.MinimumLevel.Should().Be(LogLevel.Information);
        }
Ejemplo n.º 3
0
        public void InvalidValue_ShouldThrow()
        {
            var outputMock = new Mock <IOutput>();

            outputMock.SetupProperty(o => o.MinimumLevel, LogLevel.Information);

            var sut = new VerbosityOption(outputMock.Object);

            Action act = () => sut.ReceiveValue("InvalidLevel");

            act.Should().Throw <ValidationException>();
        }