Ejemplo n.º 1
0
 public TopicController(
     IEntityById entityById,
     ITopicsSortedByName topicsSortedByName,
     IGroupsSortedByName groupsSortedByName,
     ICreateTopicCommand createTopicCommand,
     IUpdateTopicCommand updateTopicCommand,
     IDeleteTopicCommand deleteTopicCommand)
 {
     this.entityById = entityById;
     this.topicsSortedByName = topicsSortedByName;
     this.groupsSortedByName = groupsSortedByName;
     this.createTopicCommand = createTopicCommand;
     this.updateTopicCommand = updateTopicCommand;
     this.deleteTopicCommand = deleteTopicCommand;
 }
Ejemplo n.º 2
0
 public TopicController(
     IEntityById entityById,
     ITopicsSortedByName topicsSortedByName,
     IGroupsSortedByName groupsSortedByName,
     ICreateTopicCommand createTopicCommand,
     IUpdateTopicCommand updateTopicCommand,
     IDeleteTopicCommand deleteTopicCommand)
 {
     this.entityById         = entityById;
     this.topicsSortedByName = topicsSortedByName;
     this.groupsSortedByName = groupsSortedByName;
     this.createTopicCommand = createTopicCommand;
     this.updateTopicCommand = updateTopicCommand;
     this.deleteTopicCommand = deleteTopicCommand;
 }
Ejemplo n.º 3
0
        private static TopicController CreateController(
            ITopicsSortedByName topicsSortedByName = null,
            IEntityById entityById = null,
            IGroupsSortedByName groupsSortedByName = null,
            ICreateTopicCommand createTopicCommand = null,
            IUpdateTopicCommand updateTopicCommand = null,
            IDeleteTopicCommand deleteTopicCommand = null)

        {
            var defaultGroupQuery = Mock.Of <IGroupsSortedByName>(q => q.Execute() == new Group[] { SampleGroup });

            return(new TopicController(entityById ?? Mock.Of <IEntityById>(),
                                       topicsSortedByName ?? Mock.Of <ITopicsSortedByName>(),
                                       groupsSortedByName ?? defaultGroupQuery,
                                       createTopicCommand ?? Mock.Of <ICreateTopicCommand>(),
                                       updateTopicCommand ?? Mock.Of <IUpdateTopicCommand>(),
                                       deleteTopicCommand ?? Mock.Of <IDeleteTopicCommand>()
                                       ));
        }
Ejemplo n.º 4
0
 private static TopicController CreateController(
     ITopicsSortedByName topicsSortedByName = null,
     IEntityById entityById = null,
     IGroupsSortedByName groupsSortedByName = null,
     ICreateTopicCommand createTopicCommand = null,
     IUpdateTopicCommand updateTopicCommand = null,
     IDeleteTopicCommand deleteTopicCommand = null)
 {
     var defaultGroupQuery = Mock.Of<IGroupsSortedByName>(q => q.Execute() == new Group[]{SampleGroup});
     return new TopicController( entityById ?? Mock.Of<IEntityById>(),
                                 topicsSortedByName ?? Mock.Of<ITopicsSortedByName>(),
                                 groupsSortedByName ?? defaultGroupQuery,
                                 createTopicCommand ?? Mock.Of<ICreateTopicCommand>(),
                                 updateTopicCommand ?? Mock.Of<IUpdateTopicCommand>(),
                                 deleteTopicCommand ?? Mock.Of<IDeleteTopicCommand>()
                                 );
 }