public void VerifyEventOccured(MockEventType eventType, string eventText, bool partialMatch) { bool found = false; foreach (MockEvent evnt in Events) { if (partialMatch) { if (evnt.EventType == eventType && evnt.Payload.Contains(eventText)) { found = true; break; } } else { if (evnt.EventType == eventType && evnt.Payload == eventText) { found = true; break; } } } Assert.True(found, "Could not find event of type \"{0}\" with text \"{1}\"", eventType, eventText); }
public MockEvent(MockEventType type, string payload) { Time = DateTime.Now; EventType = type; Payload = payload; }