public void TargetType()
        {
            // Arrange
            IConverter converter = new BooleanConverter();
            var expectedType = typeof(bool);

            // Act
            var actual = converter.TargetType;

            // Assert
            Assert.Equal(expectedType, actual);
        }
        public void StringEmptyConversion()
        {
            // Arrange
            IConverter converter = new BooleanConverter();
            var value = string.Empty;

            // Act
            var actual = converter.Convert(value, converter.TargetType);

            // Assert
            Assert.NotNull(actual);
            Assert.IsType<bool>(actual);
            Assert.True((bool)actual);
        }
        public void LowerFalseConversion()
        {
            // Arrange
            IConverter converter = new BooleanConverter();
            var value = "false";

            // Act
            var actual = converter.Convert(value, converter.TargetType);

            // Assert
            Assert.NotNull(actual);
            Assert.IsType<bool>(actual);
            Assert.False((bool)actual);
        }
        public void BadValueConversion()
        {
            // Arrange
            IConverter converter = new BooleanConverter();
            var value = "Hello";
            var expectedExceptionMessage = Constants.ExceptionMessages.FormatConverterUnableConvert(value, typeof(bool));
            var expectedInnerExceptionMessage = "String was not recognized as a valid Boolean.";

            // Act
            using (new LangageSwitcher("en-us"))
            {
                var actualException = Assert.Throws<CommandLineParserException>(() => converter.Convert(value, converter.TargetType));

                // Assert
                Assert.Equal(expectedExceptionMessage, actualException.Message);
                Assert.NotNull(actualException.InnerException);
                var actualInnerExecption = Assert.IsAssignableFrom<FormatException>(actualException.InnerException);
                Assert.Equal(expectedInnerExceptionMessage, actualInnerExecption.Message);
            }
        }