public void ConvertTypeWithCustomConverter() { RedisValueConverter.RegisterConverter(new MockCustomerConverter()); RedisValue redisVal; Guid guid = Convert(Guid.NewGuid(), out redisVal); Assert.AreEqual(MockCustomerConverter.MockGuidValue, guid); Assert.AreEqual(MockCustomerConverter.MockRedisValue, redisVal); RedisValueConverter.UnregisterConverter <Guid>(); }
public void CheckConvertable() { RedisValueConverter.RegisterConverter(typeof(object), new MockCustomerConverter()); Assert.IsTrue(RedisValueConverter.IsConvertable <int>()); Assert.IsTrue(RedisValueConverter.IsConvertable <int?>()); Assert.IsTrue(RedisValueConverter.IsConvertable <TestEnum>()); Assert.IsTrue(RedisValueConverter.IsConvertable <TestEnum?>()); Assert.IsTrue(RedisValueConverter.IsConvertable <object>()); RedisValueConverter.UnregisterConverter <object>(); Assert.IsFalse(RedisValueConverter.IsConvertable <object>()); }