public async Task GetPiplelineDescriptions() { var descriptions = new NotificationPipelineDescriptions(); Mock <INotificationEngine> notificationEngineMock = new Mock <INotificationEngine>(MockBehavior.Strict); notificationEngineMock.Setup(x => x.GetPiplelineDescriptions()).ReturnsAsync(descriptions).Verifiable(); var controller = new NotificationsController( notificationEngineMock.Object, Mock.Of <IMediator>(MockBehavior.Strict), Mock.Of <ILogger <NotificationsController> >()); var actionResult = await controller.GetPiplelineDescriptions(); var result = actionResult.EnsureOkObjectResult <NotificationPipelineDescriptions>(true); Assert.Equal(descriptions, result); }