コード例 #1
0
        public virtual void TestReadWrite()
        {
            MockWriteContext writeContext = new MockWriteContext(Db());
            ulong            expected     = 0x1122334455667788;

            ULongHandler().Write(writeContext, expected);
            MockReadContext readContext = new MockReadContext(writeContext);
            ulong           ulongValue  = (ulong)ULongHandler().Read(readContext);

            Assert.AreEqual(expected, ulongValue);
        }
コード例 #2
0
        public virtual void TestReadWrite()
        {
            MockWriteContext writeContext = new MockWriteContext(Db());
            decimal          expected     = Decimal.MaxValue;

            DecimalHandler().Write(writeContext, expected);
            MockReadContext readContext  = new MockReadContext(writeContext);
            decimal         decimalValue = (decimal)DecimalHandler().Read(readContext);

            Assert.AreEqual(expected, decimalValue);
        }
コード例 #3
0
        public virtual void TestReadWrite()
        {
            MockWriteContext writeContext = new MockWriteContext(Db());
            sbyte            expected     = 0x11;

            SByteHandler().Write(writeContext, expected);
            MockReadContext readContext = new MockReadContext(writeContext);
            sbyte           sbyteValue  = (sbyte)SByteHandler().Read(readContext);

            Assert.AreEqual(expected, sbyteValue);
        }
コード例 #4
0
ファイル: UIntHandlerTestCase.cs プロジェクト: pondyond/db4o
        public virtual void TestReadWrite()
        {
            var  writeContext = new MockWriteContext(Db());
            uint expected     = 0x11223344;

            UIntHandler().Write(writeContext, expected);
            var readContext = new MockReadContext(writeContext);
            var uintValue   = (uint)UIntHandler().Read(readContext);

            Assert.AreEqual(expected, uintValue);
        }
コード例 #5
0
        public virtual void TestReadWrite()
        {
            var    writeContext = new MockWriteContext(Db());
            ushort expected     = 0x1122;

            UShortHandler().Write(writeContext, expected);
            var readContext = new MockReadContext(writeContext);
            var ushortValue = (ushort)UShortHandler().Read(readContext);

            Assert.AreEqual(expected, ushortValue);
        }
コード例 #6
0
        public virtual void TestReadWrite()
        {
            MockWriteContext writeContext = new MockWriteContext(Db());
            DateTime         expected     = new DateTime();

            DateTimeHandler().Write(writeContext, expected);
            MockReadContext readContext = new MockReadContext(writeContext);
            DateTime        actual      = (DateTime)DateTimeHandler().Read(readContext);

            Assert.AreEqual(expected, actual);
        }