Commit d43495ce authored by Marc Gravell's avatar Marc Gravell

Assert: conversion can be dynamic

parent ad04b042
...@@ -148,5 +148,18 @@ public void ValuesAreConvertible() ...@@ -148,5 +148,18 @@ public void ValuesAreConvertible()
Assert.AreEqual((byte)'2', blob[1]); Assert.AreEqual((byte)'2', blob[1]);
Assert.AreEqual((byte)'3', blob[2]); Assert.AreEqual((byte)'3', blob[2]);
} }
[Test]
public void CanBeDynamic()
{
RedisValue val = "abc";
object o = val;
dynamic d = o;
byte[] blob = (byte[])d; // could be in a try/catch
Assert.AreEqual(3, blob.Length);
Assert.AreEqual((byte)'a', blob[0]);
Assert.AreEqual((byte)'b', blob[1]);
Assert.AreEqual((byte)'c', blob[2]);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment