コード例 #1
0
 public SongController(SongService service, SongQueries queries, SongListQueries songListQueries, MarkdownParser markdownParser)
 {
     this.service         = service;
     this.queries         = queries;
     this.songListQueries = songListQueries;
     this.markdownParser  = markdownParser;
 }
コード例 #2
0
        public void SetUp()
        {
            producer  = CreateEntry.Producer(id: 1, name: "Tripshots");
            vocalist  = CreateEntry.Vocalist(id: 39, name: "Hatsune Miku");
            vocalist2 = CreateEntry.Vocalist(id: 40, name: "Kagamine Rin");

            song = CreateEntry.Song(id: 1, name: "Nebula");
            song.LengthSeconds = 39;
            repository         = new FakeSongRepository(song);
            Save(song.AddArtist(producer));
            Save(song.AddArtist(vocalist));
            Save(song.CreatePV(new PVContract {
                Id = 1, Service = PVService.Youtube, PVId = "hoLu7c2XZYU", Name = "Nebula", PVType = PVType.Original
            }));
            repository.SaveNames(song);

            user         = CreateEntry.User(id: 1, name: "Miku");
            user.GroupId = UserGroupId.Trusted;
            user2        = CreateEntry.User(id: 2, name: "Rin", email: "*****@*****.**");
            user3        = CreateEntry.User(id: 3, name: "Luka", email: "*****@*****.**");
            repository.Add(user, user2);
            repository.Add(producer, vocalist);

            tag = new Tag("vocarock");
            repository.Add(tag, new Tag("vocaloud"));

            releaseEvent = repository.Save(new ReleaseEvent {
                Name = "Comiket 39"
            });

            permissionContext = new FakePermissionContext(user);
            entryLinkFactory  = new EntryAnchorFactory("http://test.vocadb.net");

            newSongContract = new CreateSongContract {
                SongType = SongType.Original,
                Names    = new[] {
                    new LocalizedStringContract("Resistance", ContentLanguageSelection.English)
                },
                Artists = new[] {
                    new ArtistForSongContract {
                        Artist = new ArtistContract(producer, ContentLanguagePreference.Default)
                    },
                    new ArtistForSongContract {
                        Artist = new ArtistContract(vocalist, ContentLanguagePreference.Default)
                    },
                },
                PVUrl = "http://test.vocadb.net/"
            };

            pvParser            = new FakePVParser();
            pvParser.ResultFunc = (url, getMeta) =>
                                  VideoUrlParseResult.CreateOk(url, PVService.NicoNicoDouga, "sm393939",
                                                               getMeta ? VideoTitleParseResult.CreateSuccess("Resistance", "Tripshots", "testimg.jpg", 39) : VideoTitleParseResult.Empty);

            mailer = new FakeUserMessageMailer();

            queries = new SongQueries(repository, permissionContext, entryLinkFactory, pvParser, mailer,
                                      new FakeLanguageDetector(), new FakeUserIconFactory(), new EnumTranslations(), new InMemoryImagePersister(), new FakeObjectCache(), new Model.Utils.Config.VdbConfigManager());
        }
コード例 #3
0
ファイル: EntryApiController.cs プロジェクト: Shyany/vocadb
 public EntryApiController(EntryQueries queries, OtherService otherService, AlbumService albumService, ArtistService artistService, SongQueries songQueries, IEntryUrlParser entryUrlParser)
 {
     this.queries        = queries;
     this.otherService   = otherService;
     this.albumService   = albumService;
     this.artistService  = artistService;
     this.songQueries    = songQueries;
     this.entryUrlParser = entryUrlParser;
 }
コード例 #4
0
        public SongControllerTests()
        {
            permissionContext.SetLoggedUser(repository.Save(CreateEntry.User()));
            var queries = new SongQueries(repository, permissionContext, new FakeEntryLinkFactory(),
                                          new FakePVParser(), new FakeUserMessageMailer(), new FakeLanguageDetector(), new FakeUserIconFactory(), new EnumTranslations(), new InMemoryImagePersister(),
                                          new FakeObjectCache(), new VdbConfigManager(), new EntrySubTypeNameFactory(), new FakeFollowedArtistNotifier());

            controller = new SongController(null, queries, null, null);
        }
コード例 #5
0
ファイル: ExtController.cs プロジェクト: rijuntun/vocadb
 public ExtController(IEntryUrlParser entryUrlParser, IEntryImagePersisterOld entryThumbPersister,
                      AlbumService albumService, ArtistService artistService, SongQueries songService, TagQueries tagQueries)
 {
     this.entryUrlParser      = entryUrlParser;
     this.entryThumbPersister = entryThumbPersister;
     this.albumService        = albumService;
     this.artistService       = artistService;
     this.songService         = songService;
     this.tagQueries          = tagQueries;
 }
コード例 #6
0
ファイル: SongApiController.cs プロジェクト: rijuntun/vocadb
 /// <summary>
 /// Initializes controller.
 /// </summary>
 public SongApiController(SongService service, SongQueries queries, SongAggregateQueries songAggregateQueries,
                          IEntryLinkFactory entryLinkFactory, IUserPermissionContext userPermissionContext, UserService userService)
 {
     this.service               = service;
     this.queries               = queries;
     this.userService           = userService;
     this.songAggregateQueries  = songAggregateQueries;
     this.entryLinkFactory      = entryLinkFactory;
     this.userPermissionContext = userPermissionContext;
 }
コード例 #7
0
 public ExtController(IEntryUrlParser entryUrlParser, IAggregatedEntryImageUrlFactory entryThumbPersister,
                      AlbumService albumService, ArtistService artistService, EventQueries eventQueries, SongQueries songService, TagQueries tagQueries)
 {
     this.entryUrlParser      = entryUrlParser;
     this.entryThumbPersister = entryThumbPersister;
     this.albumService        = albumService;
     this.artistService       = artistService;
     this.eventQueries        = eventQueries;
     this.songService         = songService;
     this.tagQueries          = tagQueries;
 }
コード例 #8
0
ファイル: SongApiController.cs プロジェクト: Pyther99/vocadb
 public SongApiController(SongService service, SongQueries queries, SongAggregateQueries songAggregateQueries,
                          IEntryLinkFactory entryLinkFactory, IUserPermissionContext userPermissionContext,
                          UserService userService, OtherService otherService)
 {
     _service               = service;
     _queries               = queries;
     _userService           = userService;
     _songAggregateQueries  = songAggregateQueries;
     _entryLinkFactory      = entryLinkFactory;
     _userPermissionContext = userPermissionContext;
     _otherService          = otherService;
 }
コード例 #9
0
        public void SetUp()
        {
            producer  = CreateEntry.Producer(id: 1, name: "Tripshots");
            vocalist  = CreateEntry.Vocalist(id: 39, name: "Hatsune Miku");
            vocalist2 = CreateEntry.Vocalist(id: 40, name: "Kagamine Rin");

            song = CreateEntry.Song(id: 1, name: "Nebula");
            song.LengthSeconds = 39;
            repository         = new FakeSongRepository(song);
            Save(song.AddArtist(producer));
            Save(song.AddArtist(vocalist));
            Save(song.CreatePV(new PVContract {
                Service = PVService.Youtube, PVId = "hoLu7c2XZYU", Name = "Nebula", PVType = PVType.Original
            }));

            foreach (var name in song.Names)
            {
                repository.Save(name);
            }

            user         = CreateEntry.User(id: 1, name: "Miku");
            user.GroupId = UserGroupId.Trusted;
            user2        = CreateEntry.User(id: 2, name: "Rin", email: "*****@*****.**");
            repository.Add(user, user2);
            repository.Add(producer, vocalist);

            repository.Add(new Tag("vocarock"), new Tag("vocaloud"));

            permissionContext = new FakePermissionContext(user);
            var entryLinkFactory = new EntryAnchorFactory("http://test.vocadb.net");

            newSongContract = new CreateSongContract {
                SongType = SongType.Original,
                Names    = new[] {
                    new LocalizedStringContract("Resistance", ContentLanguageSelection.English)
                },
                Artists = new[] {
                    new ArtistContract(producer, ContentLanguagePreference.Default),
                    new ArtistContract(vocalist, ContentLanguagePreference.Default),
                },
                PVUrl = "http://test.vocadb.net/"
            };

            pvParser            = new FakePVParser();
            pvParser.ResultFunc = (url, getMeta) =>
                                  VideoUrlParseResult.CreateOk(url, PVService.NicoNicoDouga, "sm393939",
                                                               getMeta ? VideoTitleParseResult.CreateSuccess("Resistance", "Tripshots", "testimg.jpg", 39) : VideoTitleParseResult.Empty);

            mailer = new FakeUserMessageMailer();

            queries = new SongQueries(repository, permissionContext, entryLinkFactory, pvParser, mailer, new FakeLanguageDetector());
        }
コード例 #10
0
 public SongController(
     SongService service,
     SongQueries queries,
     SongListQueries songListQueries,
     MarkdownParser markdownParser,
     PVHelper pvHelper)
 {
     _service         = service;
     _queries         = queries;
     _songListQueries = songListQueries;
     _markdownParser  = markdownParser;
     _pvHelper        = pvHelper;
 }
コード例 #11
0
 public EntryApiController(
     EntryQueries queries,
     OtherService otherService,
     AlbumService albumService,
     ArtistService artistService,
     SongQueries songQueries,
     IEntryUrlParser entryUrlParser,
     IViewRenderService viewRenderService)
 {
     _queries           = queries;
     _otherService      = otherService;
     _albumService      = albumService;
     _artistService     = artistService;
     _songQueries       = songQueries;
     _entryUrlParser    = entryUrlParser;
     _viewRenderService = viewRenderService;
 }
コード例 #12
0
ファイル: QueryService.svc.cs プロジェクト: rijuntun/vocadb
 public QueryService(ArtistQueries artistQueries, TagQueries tagQueries, UserQueries userQueries,
                     AlbumService albumService, ArtistService artistService, SongQueries songQueries, SongService songService, SongListQueries songListQueries, UserService userService,
                     OtherService otherService, EntryQueries entryQueries,
                     IUserPermissionContext userPermissionContext)
 {
     this.artistQueries         = artistQueries;
     this.tagQueries            = tagQueries;
     this.userQueries           = userQueries;
     this.albumService          = albumService;
     this.artistService         = artistService;
     this.songQueries           = songQueries;
     this.entryQueries          = entryQueries;
     this.songService           = songService;
     this.songListQueries       = songListQueries;
     this.userService           = userService;
     this.otherService          = otherService;
     this.userPermissionContext = userPermissionContext;
 }
コード例 #13
0
 public ExtController(
     IEntryUrlParser entryUrlParser,
     IAggregatedEntryImageUrlFactory entryThumbPersister,
     AlbumService albumService,
     ArtistService artistService,
     EventQueries eventQueries,
     SongQueries songService,
     TagQueries tagQueries,
     PVHelper pvHelper)
 {
     _entryUrlParser      = entryUrlParser;
     _entryThumbPersister = entryThumbPersister;
     _albumService        = albumService;
     _artistService       = artistService;
     _eventQueries        = eventQueries;
     _songService         = songService;
     _tagQueries          = tagQueries;
     _pvHelper            = pvHelper;
 }
コード例 #14
0
 /// <summary>
 /// Initializes controller.
 /// </summary>
 /// <param name="service">Song service. Cannot be null.</param>
 /// <param name="queries">Song queries. Cannot be null.</param>
 public SongApiController(SongService service, SongQueries queries)
 {
     this.service = service;
     this.queries = queries;
 }
コード例 #15
0
ファイル: HomeController.cs プロジェクト: AgFlore/vocadb
 public HomeController(SongQueries songService, OtherService otherService, BrandableStringsManager brandableStringsManager)
 {
     _songService             = songService;
     _otherService            = otherService;
     _brandableStringsManager = brandableStringsManager;
 }
コード例 #16
0
 public SongController(SongService service, SongQueries queries, SongListQueries songListQueries)
 {
     this.service         = service;
     this.queries         = queries;
     this.songListQueries = songListQueries;
 }
コード例 #17
0
ファイル: SongController.cs プロジェクト: realzhaorong/vocadb
 public SongController(SongService service, SongQueries queries, SongListQueries songListQueries)
 {
     this.service = service;
     this.queries = queries;
     this.songListQueries = songListQueries;
 }
コード例 #18
0
 /// <summary>
 /// Initializes controller.
 /// </summary>
 /// <param name="service">Song service. Cannot be null.</param>
 /// <param name="queries">Song queries. Cannot be null.</param>
 public SongApiController(SongService service, SongQueries queries)
 {
     this.service = service;
     this.queries = queries;
 }