예제 #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());
        }
예제 #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);
        }
예제 #3
0
 public void TestWriteThrowsOnApiError()
 {
     Proc.Read(IntPtr.Zero, OutStream.GetBuffer(), 4);
 }
예제 #4
0
 public void TestReadThrowsIfBufferNotLargeEnough()
 {
     Proc.Read(IntPtr.Zero, OutStream.GetBuffer(), 10000);
 }