Example #1
0
        public static void Boolean_ReturnsFalse_ForEmptyString_EmptyOrWhiteSpaceIsFalseStyle(string value)
        {
            var result = ParseTo.Boolean(value, BooleanStyles.EmptyOrWhiteSpaceIsFalse);

            Assert.True(result.HasValue);
            Assert.False(result.Value);
        }
Example #2
0
        public static void Boolean_ReturnsFalse_ForLiteralZero_ZeroOrOneStyle(string value)
        {
            var result = ParseTo.Boolean(value, BooleanStyles.ZeroOrOne);

            Assert.True(result.HasValue);
            Assert.False(result.Value);
        }
Example #3
0
        public static void Boolean_ReturnsTrue_ForLiteralTrue_LiteralStyle(string value)
        {
            var result = ParseTo.Boolean(value, BooleanStyles.Literal);

            Assert.True(result.HasValue);
            Assert.True(result.Value);
        }
Example #4
0
        public static void Boolean_ReturnsNull_ForInvalidInput_ZeroOrOneStyle(string value)
        {
            var result = ParseTo.Boolean(value, BooleanStyles.ZeroOrOne);

            Assert.False(result.HasValue);
        }
Example #5
0
        public static void Boolean_ReturnsNull_ForNullString()
        {
            var result = ParseTo.Boolean(null);

            Assert.False(result.HasValue);
        }