Skip to content

Instantly share code, notes, and snippets.

@grumpydev
Created January 24, 2011 13:41
Show Gist options
  • Select an option

  • Save grumpydev/793222 to your computer and use it in GitHub Desktop.

Select an option

Save grumpydev/793222 to your computer and use it in GitHub Desktop.
[TestMethod]
public void ProcessMessage_LowerPacketSequenceNumberWithDifferentHandsetUid_RaisesBothEvents()
{
var mockEventDispatcher = A.Fake<IDeviceEvents>();
var fakeMessage1 = new HardwareMessage(MessageType.ReportKeyValue, 0, GetButtonPressParameters(1, 2, HardwareButton.BlueCircle));
var fakeMessage2 = new HardwareMessage(MessageType.ReportKeyValue, 0, GetButtonPressParameters(2, 1, HardwareButton.BlueCircle));
_ReportKeyValueHandler.ProcessMessage(_FakeDevice, mockEventDispatcher, fakeMessage1);
_ReportKeyValueHandler.ProcessMessage(_FakeDevice, mockEventDispatcher, fakeMessage2);
A.CallTo(() => mockEventDispatcher.RaiseButtonPressedEvent(A<uint>.Ignored, A<HardwareButton>.Ignored)).MustHaveHappened(Repeated.Twice);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment