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