Beispiel #1
0
 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 StoryController(IStoryReadService service, IStoryRepository repository)
 {
     this.repository       = repository;
     this.storyReadService = service;
 }
 public StoryControllerTest()
 {
     repo    = Mock.Create <IStoryRepository>();
     service = Mock.Create <IStoryReadService>();
     target  = new StoryController(service, repo);
 }
 public OverviewControllerTests()
 {
     repo    = Mock.Create <IStoryRepository>();
     service = Mock.Create <IStoryReadService>();
     target  = new OverviewController(service);
 }
Beispiel #5
0
 public OverviewController(IStoryReadService storyReadService)
 {
     this.storyReadService = storyReadService;
 }