public async Task PublishMessageTestWithBasicDirectInjection() { var _demoController = new DemoController(new TestPublisher()); var actionResult = await _demoController.PublishMessage("test"); Assert.IsType <AcceptedResult>(actionResult); }
public async Task PublishMessageTest() { var _mockEventPub = new Mock <IEventPublisher>(); var _demoController = new DemoController(_mockEventPub.Object); var actionResult = await _demoController.PublishMessage("test"); Assert.IsType <AcceptedResult>(actionResult); }