public async Task ActivityDocumentation_WhenDocumentationTypeIsIncorrect_ReturnsBadRequest() { var controller = new DocumentationController(_activityMock.Object, _terminalMock.Object); var result = await controller.Activity(new ActivityDTO { Documentation = "something" }); Assert.IsTrue(result is BadRequestErrorMessageResult, "Wrong result type is returned for incorrect documentation type"); }
public async Task ActivityDocumentation_WhenDocumentationIsForMainPage_ReturnsSolutionDocumentation() { var controller = new DocumentationController(_activityMock.Object, _terminalMock.Object); var result = await controller.Activity(new ActivityDTO { Documentation = "MainPage" }); Assert.IsTrue(result is OkNegotiatedContentResult <DocumentationResponseDTO>, "Wrong result type is returned for solution documentation type"); _activityMock.Verify(x => x.GetActivityDocumentation <DocumentationResponseDTO>(It.IsAny <ActivityDTO>(), true), Times.Once(), "Solution documentation was not requested"); }
public async Task ActivityDocumentation_WhenDocumentationIsForTerminal_ReturnsSolutionsDocumentations() { var controller = new DocumentationController(_activityMock.Object, _terminalMock.Object); var result = await controller.Activity(new ActivityDTO { Documentation = "Terminal=t" }); Assert.IsTrue(result is OkNegotiatedContentResult <List <DocumentationResponseDTO> >, "Wrong result type is returned for terminal documentation type"); _terminalMock.Verify(x => x.GetSolutionDocumentations("t"), Times.Once(), "Terminal documentation was not requested"); }