Example #1
0
    public void Invalid_Value_Returns_False(object input)
    {
        // Arrange
        var handler = new BooleanTypeHandler();

        // Act
        var result = handler.Parse(input);

        // Assert
        Assert.False(result);
    }
Example #2
0
 /// <summary>
 /// Adds instances of type handlers to the internal cache.
 /// </summary>
 static TypeHandlerFactory()
 {
     CACHE[typeof(Boolean)]  = new BooleanTypeHandler();
     CACHE[typeof(Char)]     = new CharTypeHandler();
     CACHE[typeof(DateTime)] = new DateTimeTypeHandler();
     CACHE[typeof(Decimal)]  = new DecimalTypeHandler();
     CACHE[typeof(Double)]   = new DoubleTypeHandler();
     CACHE[typeof(float)]    = new FloatTypeHandler();
     CACHE[typeof(int)]      = new IntegerTypeHandler();
     CACHE[typeof(long)]     = new LongTypeHandler();
     CACHE[typeof(short)]    = new ShortTypeHandler();
 }
Example #3
0
        public void BoolConverterTest02()
        {
            const string val = "1";

            Assert.AreEqual(true, BooleanTypeHandler.Convert(DataItemUtilities.ProcessPattern(val, null)));
        }