Ejemplo n.º 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>()));
 }
Ejemplo n.º 2
0
 public StoryController(IStoryReadService service, IStoryRepository repository)
 {
     this.repository       = repository;
     this.storyReadService = service;
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 5
0
 public OverviewController(IStoryReadService storyReadService)
 {
     this.storyReadService = storyReadService;
 }