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; }
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>() )); }
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>() ); }