public void InterceptWndProcWillCallManipulatePositionIfMessageIsWmMoveAndEnabledIsTrue() { // Arrange var interceptMoveWindowMessageBehavior = new DummyInterceptMoveWindowMessageBehavior(); var manipulatePositionResult = false; var windowMessage = (Int32)WindowMessage.WM_MOVE; interceptMoveWindowMessageBehavior.Enabled = true; using (var rectStructure = DisposableStructure <Rect> .Create()) { // Act interceptMoveWindowMessageBehavior.DummyInterceptWndProc(IntPtr.Zero, windowMessage, IntPtr.Zero, rectStructure.StructurePointer, ref manipulatePositionResult); // Assert manipulatePositionResult.Should().BeTrue(); } }
public void InterceptWndProcWillReturnIntPtrZeroIfWmMoveAndEnabledIsTrue() { // Arrange var interceptMoveWindowMessageBehavior = new DummyInterceptMoveWindowMessageBehavior(); var manipulatePositionResult = false; var windowMessage = (Int32)WindowMessage.WM_MOVE; interceptMoveWindowMessageBehavior.Enabled = true; var interceptWndProcResult = new IntPtr(new Random().Next(1, Int32.MaxValue)); using (var rectStructure = DisposableStructure <Rect> .Create()) { // Act interceptWndProcResult = interceptMoveWindowMessageBehavior.DummyInterceptWndProc(IntPtr.Zero, windowMessage, IntPtr.Zero, rectStructure.StructurePointer, ref manipulatePositionResult); // Assert interceptWndProcResult.Should().Be(IntPtr.Zero); } }