コード例 #1
0
        public void SetUp()
        {
            artist     = CreateEntry.Producer(name: "Tripshots");
            vocalist   = CreateEntry.Vocalist(name: "Hatsune Miku");
            repository = new FakeArtistRepository(artist, vocalist);
            var weblink = new ArtistWebLink(artist, "Website", "http://tripshots.net", WebLinkCategory.Official);

            artist.WebLinks.Add(weblink);
            repository.Save(weblink);
            repository.SaveNames(artist, vocalist);

            user = CreateEntry.User(name: "Miku", group: UserGroupId.Moderator);
            repository.Save(user);
            permissionContext = new FakePermissionContext(user);
            imagePersister    = new InMemoryImagePersister();

            queries = new ArtistQueries(repository, permissionContext, new FakeEntryLinkFactory(), imagePersister, imagePersister, MemoryCache.Default,
                                        new FakeUserIconFactory(), new EnumTranslations());

            newArtistContract = new CreateArtistContract {
                ArtistType  = ArtistType.Producer,
                Description = string.Empty,
                Names       = new[] {
                    new LocalizedStringContract("Tripshots", ContentLanguageSelection.English)
                },
                WebLink = new WebLinkContract("http://tripshots.net/", "Website", WebLinkCategory.Official)
            };
        }
コード例 #2
0
ファイル: ArtistWebLink.cs プロジェクト: realzhaorong/vocadb
        public virtual bool Equals(ArtistWebLink another)
        {
            if (another == null)
                return false;

            if (ReferenceEquals(this, another))
                return true;

            return this.Id == another.Id;
        }
コード例 #3
0
        public virtual bool Equals(ArtistWebLink another)
        {
            if (another == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, another))
            {
                return(true);
            }

            return(this.Id == another.Id);
        }
コード例 #4
0
ファイル: ArtistQueriesTests.cs プロジェクト: AgFlore/vocadb
        public void SetUp()
        {
            _artist     = CreateEntry.Producer(name: "Tripshots");
            _vocalist   = CreateEntry.Vocalist(name: "Hatsune Miku");
            _repository = new FakeArtistRepository(_artist, _vocalist);
            var weblink = new ArtistWebLink(_artist, "Website", "http://tripshots.net", WebLinkCategory.Official, disabled: false);

            _artist.WebLinks.Add(weblink);
            _repository.Save(weblink);
            _repository.SaveNames(_artist, _vocalist);

            _user  = CreateEntry.User(name: "Miku", group: UserGroupId.Moderator);
            _user2 = CreateEntry.User(name: "Rin", group: UserGroupId.Regular);
            _repository.Save(_user);
            _permissionContext = new FakePermissionContext(_user);
            _imagePersister    = new InMemoryImagePersister();

            _queries = new ArtistQueries(
                _repository,
                _permissionContext,
                new FakeEntryLinkFactory(),
                _imagePersister,
                _imagePersister,
                MemoryCache.Default,
                new FakeUserIconFactory(),
                new EnumTranslations(),
                _imagePersister,
                new FakeDiscordWebhookNotifier());

            _newArtistContract = new CreateArtistContract
            {
                ArtistType  = ArtistType.Producer,
                Description = string.Empty,
                Names       = new[] {
                    new LocalizedStringContract("Tripshots", ContentLanguageSelection.English)
                },
                WebLink = new WebLinkContract("http://tripshots.net/", "Website", WebLinkCategory.Official, disabled: false)
            };
        }