public void ShouldCallServiceOnContext() { var haContextMock = new Mock <IHaContext>(); var entity = new TestEntity(haContextMock.Object, "domain.testEntity"); var data = "payload"; entity.CallService("service", data); haContextMock.Verify(h => h.CallService("domain", "service", It.Is <ServiceTarget>(t => t.EntityIds !.Single() == entity.EntityId), data), Times.Once); }