public void DynamicMemberInspectorExercise() { uint a = 1; ushort b = 2; ushort c = 3; byte d = 4; byte e = 5; byte f = 6; byte g = 7; byte h = 8; byte i = 9; byte j = 10; byte k = 11; var guid = new Guid(a, b, c, d, e, f, g, h, i, j, k); var dmi = (dynamic)DynamicMemberInspector_Accessor.Wrap(guid); Assert.AreEqual <uint>(a, (uint)dmi._a); Assert.AreEqual <ushort>(b, (ushort)dmi._b); Assert.AreEqual <ushort>(c, (ushort)dmi._c); Assert.AreEqual <byte>(d, (byte)dmi._d); Assert.AreEqual <byte>(e, (byte)dmi._e); Assert.AreEqual <byte>(f, (byte)dmi._f); Assert.AreEqual <byte>(g, (byte)dmi._g); Assert.AreEqual <byte>(h, (byte)dmi._h); Assert.AreEqual <byte>(i, (byte)dmi._i); Assert.AreEqual <byte>(j, (byte)dmi._j); Assert.AreEqual <byte>(k, (byte)dmi._k); }
public void DynamicMemberInspectorOnNonExistantField() { var dmi = (dynamic)DynamicMemberInspector_Accessor.Wrap(Guid.NewGuid()); var value = dmi._z; }