public StoryReadServiceTests() { storyRepos = Mock.Create <IStoryRepository>(); nodeService = Mock.Create <IAsyncNodeService>(); storySectionRepository = Mock.Create <IStorySectionRepository>(); target = new StoryReadService(storyRepos, nodeService, storySectionRepository); testStory = new Story { Id = 1, Title = "A Story", Synopsis = "A Summary" }; Mock.Arrange(() => storyRepos.GetAsync(testStory.Id)) .Returns(() => Task.FromResult(testStory)); Mock.Arrange(() => nodeService.Get(Arg.IsAny <INode>(), Arg.IsAny <NodeType <Actor> >())) .Returns(() => Task.FromResult(new List <Actor>())); Mock.Arrange(() => storySectionRepository.GetTreeForStory(Arg.AnyInt)) .Returns(() => Task.FromResult(new OrderedHierarchicalTree <StorySection>())); }
public StoryReadService(IStoryRepository storyRepository, IAsyncNodeService nodeService, IStorySectionRepository storySectionRepository) { this.storyRepository = storyRepository; this.nodeService = nodeService; this.storySectionRepository = storySectionRepository; }