public void CreateTest() { //Arrange var mockStory = new Mock <IStoryService>(); var mockSprint = new Mock <ISprintService>(); StoryDTO storyDTO = new StoryDTO(); SprintDTO sprintDTO = new SprintDTO(); mockStory.Setup(a => a.CreateStory(storyDTO)); mockSprint.Setup(a => a.Create(sprintDTO)); StoryController controller = new StoryController(mockStory.Object, mockSprint.Object); //Act var result = controller.CreateStory(storyDTO); //Assert Assert.IsType <CreatedResult>(result); }
public void DeleteStoryTest() { //Arrange var mock = new Mock <IStoryService>(); var mockSprint = new Mock <ISprintService>(); SprintDTO sprintDTO = new SprintDTO(); mockSprint.Setup(a => a.Create(sprintDTO)); StoryDTO storyDTO = new StoryDTO { Name = "Test", Description = "Description" }; mock.Setup(a => a.CreateStory(storyDTO)); StoryController controller = new StoryController(mock.Object, mockSprint.Object); var temp = controller.CreateStory(storyDTO); //Act var result = controller.DeleteStory(storyDTO.Story_id); //Assert Assert.IsType <OkResult>(result); }