Exemplo n.º 1
0
        public unsafe void TestRead()
        {
            int    number  = 30;
            IntPtr address = (IntPtr)(&number);

            OutStream.SetLength(4);
            Proc.Read(address, OutStream.GetBuffer(), 4);
            Assert.AreEqual(number, Reader.ReadInt32());
        }
Exemplo n.º 2
0
        public unsafe void TestWrite()
        {
            int number = 30;

            Writer.Write(number);

            int    result  = 0;
            IntPtr address = (IntPtr)(&result);

            Proc.Write(address, OutStream.GetBuffer(), 4);
            Assert.AreEqual(number, result);
        }
Exemplo n.º 3
0
 public void TestWriteThrowsOnApiError()
 {
     Proc.Read(IntPtr.Zero, OutStream.GetBuffer(), 4);
 }
Exemplo n.º 4
0
 public void TestReadThrowsIfBufferNotLargeEnough()
 {
     Proc.Read(IntPtr.Zero, OutStream.GetBuffer(), 10000);
 }