From 4cb9f48e847a7874b24248cd48a851a907aa9beb Mon Sep 17 00:00:00 2001 From: Omar Pani Date: Sun, 7 Feb 2021 18:29:55 +0100 Subject: [PATCH 1/4] Updated song model --- Genius/Genius/Clients/ArtistClient.cs | 86 +++++----- Genius/Genius/Models/Artist/Artist.cs | 6 +- Genius/Genius/Models/Response/SongResponse.cs | 18 +-- Genius/Genius/Models/Song/Annotatable.cs | 37 +++++ Genius/Genius/Models/Song/Annotation.cs | 67 ++++++++ .../Song/AnnotationCurrentUserMetadata.cs | 20 +++ Genius/Genius/Models/Song/ClientTimestamps.cs | 13 ++ .../Genius/Models/Song/CustomerPerformance.cs | 16 ++ Genius/Genius/Models/Song/Description.cs | 13 ++ .../Models/Song/DescriptionAnnotation.cs | 55 +++++++ Genius/Genius/Models/Song/Interactions.cs | 19 +++ Genius/Genius/Models/Song/IqByAction.cs | 10 ++ Genius/Genius/Models/Song/Range.cs | 13 ++ Genius/Genius/Models/Song/Song.cs | 148 ++++++++++-------- .../Models/Song/SongCurrentUserMetadata.cs | 25 +++ Genius/Genius/Models/Song/Stats.cs | 28 ++++ .../Models/Song/VerifiedAnnotationsBy.cs | 43 +++++ ...erifiedAnnotationsByCurrentUserMetadata.cs | 17 ++ .../Genius/Models/Song/VerifiedContributor.cs | 19 +++ Genius/Genius/Models/User/User.cs | 18 +-- 20 files changed, 540 insertions(+), 131 deletions(-) create mode 100644 Genius/Genius/Models/Song/Annotatable.cs create mode 100644 Genius/Genius/Models/Song/Annotation.cs create mode 100644 Genius/Genius/Models/Song/AnnotationCurrentUserMetadata.cs create mode 100644 Genius/Genius/Models/Song/ClientTimestamps.cs create mode 100644 Genius/Genius/Models/Song/CustomerPerformance.cs create mode 100644 Genius/Genius/Models/Song/Description.cs create mode 100644 Genius/Genius/Models/Song/DescriptionAnnotation.cs create mode 100644 Genius/Genius/Models/Song/Interactions.cs create mode 100644 Genius/Genius/Models/Song/IqByAction.cs create mode 100644 Genius/Genius/Models/Song/Range.cs create mode 100644 Genius/Genius/Models/Song/SongCurrentUserMetadata.cs create mode 100644 Genius/Genius/Models/Song/Stats.cs create mode 100644 Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs create mode 100644 Genius/Genius/Models/Song/VerifiedAnnotationsByCurrentUserMetadata.cs create mode 100644 Genius/Genius/Models/Song/VerifiedContributor.cs diff --git a/Genius/Genius/Clients/ArtistClient.cs b/Genius/Genius/Clients/ArtistClient.cs index fb6b707..60c8431 100644 --- a/Genius/Genius/Clients/ArtistClient.cs +++ b/Genius/Genius/Clients/ArtistClient.cs @@ -8,60 +8,60 @@ namespace Genius.Clients { - public class ArtistClient : IArtistClient - { - private static IGeniusRestClient _geniusRestClient; - - public ArtistClient(IGeniusRestClient geniusRestClient) + public class ArtistClient : IArtistClient { - _geniusRestClient = geniusRestClient; - } + private static IGeniusRestClient _geniusRestClient; - public async Task GetArtist(ulong artistId) - { - var response = await _geniusRestClient.GetASync("/artists/" + artistId + "?text_format=html"); + public ArtistClient(IGeniusRestClient geniusRestClient) + { + _geniusRestClient = geniusRestClient; + } - using (var input = new StringReader(response)) - { - var artistResponse = JSON.Deserialize(input); - if (artistResponse.Meta.Status >= 400) + public async Task GetArtist(ulong artistId) { - throw new HttpRequestException(artistResponse.Meta.Status + - artistResponse.Meta.Message); + var response = await _geniusRestClient.GetASync("/artists/" + artistId + "?text_format=html"); + + using (var input = new StringReader(response)) + { + var artistResponse = JSON.Deserialize(input); + if (artistResponse.Meta.Status >= 400) + { + throw new HttpRequestException(artistResponse.Meta.Status + + artistResponse.Meta.Message); + } + + return artistResponse; + } } - return artistResponse; - } - } + public async Task GetArtistsSongs(ulong artistId, string sort = "default", + string perPage = null, string page = null) + { + var endpoint = "/artists/" + artistId + "/songs?" + "sort=" + sort; - public async Task GetArtistsSongs(ulong artistId, string sort = "default", - string perPage = null, string page = null) - { - var endpoint = "/artists/" + artistId + "/songs?" + "sort=" + sort; + if (!string.IsNullOrWhiteSpace(perPage)) + { + endpoint += "&per_page=" + perPage; + } - if (!string.IsNullOrWhiteSpace(perPage)) - { - endpoint += "&per_page=" + perPage; - } + if (!string.IsNullOrWhiteSpace(page)) + { + endpoint += "&page=" + page; + } - if (!string.IsNullOrWhiteSpace(page)) - { - endpoint += "&page=" + page; - } + var response = await _geniusRestClient.GetASync(endpoint); - var response = await _geniusRestClient.GetASync(endpoint); + using (var input = new StringReader(response)) + { + var artistsSongsResponse = JSON.Deserialize(input); + if (artistsSongsResponse.Meta.Status >= 400) + { + throw new HttpRequestException(artistsSongsResponse.Meta.Status + + artistsSongsResponse.Meta.Message); + } - using (var input = new StringReader(response)) - { - var artistsSongsResponse = JSON.Deserialize(input); - if (artistsSongsResponse.Meta.Status >= 400) - { - throw new HttpRequestException(artistsSongsResponse.Meta.Status + - artistsSongsResponse.Meta.Message); + return artistsSongsResponse; + } } - - return artistsSongsResponse; - } } - } } \ No newline at end of file diff --git a/Genius/Genius/Models/Artist/Artist.cs b/Genius/Genius/Models/Artist/Artist.cs index 2f4a3b2..afc4521 100644 --- a/Genius/Genius/Models/Artist/Artist.cs +++ b/Genius/Genius/Models/Artist/Artist.cs @@ -16,11 +16,11 @@ public class Artist [JilDirective(Name = "facebook_name")] public string FacebookName { get; set; } - [JilDirective(Name = "followers_count")] public ulong FollowersCount { get; set; } + [JilDirective(Name = "followers_count")] public ulong? FollowersCount { get; set; } [JilDirective(Name = "header_image_url")] public string HeaderImageUrl { get; set; } - [JilDirective(Name = "id")] public ulong Id { get; set; } + [JilDirective(Name = "id")] public ulong? Id { get; set; } [JilDirective(Name = "image_url")] public string ImageUrl { get; set; } @@ -40,7 +40,7 @@ public class Artist [JilDirective(Name = "current_user_metadata")] public UserMetadata CurrentUserMetadata { get; set; } - [JilDirective(Name = "iq")] public ulong Iq { get; set; } + [JilDirective(Name = "iq")] public ulong? Iq { get; set; } [JilDirective(Name = "description_annotation")] public Referent.Referent DescriptionAnnotation { get; set; } diff --git a/Genius/Genius/Models/Response/SongResponse.cs b/Genius/Genius/Models/Response/SongResponse.cs index 26789ac..c09c250 100644 --- a/Genius/Genius/Models/Response/SongResponse.cs +++ b/Genius/Genius/Models/Response/SongResponse.cs @@ -4,15 +4,15 @@ namespace Genius.Models.Response { - public class SongResponse - { - [JilDirective(Name = "meta")] public Meta Meta { get; set; } + public class SongResponse + { + [JilDirective(Name = "meta")] public Meta Meta { get; set; } - [JilDirective(Name = "response")] public SongData Response { get; set; } - } + [JilDirective(Name = "response")] public SongData Response { get; set; } + } - public class SongData - { - [JilDirective(Name = "song")] public Song.Song Song { get; set; } - } + public class SongData + { + [JilDirective(Name = "song")] public Song.Song Song { get; set; } + } } \ No newline at end of file diff --git a/Genius/Genius/Models/Song/Annotatable.cs b/Genius/Genius/Models/Song/Annotatable.cs new file mode 100644 index 0000000..dd79622 --- /dev/null +++ b/Genius/Genius/Models/Song/Annotatable.cs @@ -0,0 +1,37 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class Annotatable + { + [JilDirective("api_path")] + public string ApiPath { get; set; } + + [JilDirective("client_timestamps")] + public ClientTimestamps ClientTimestamps { get; set; } + + [JilDirective("context")] + public string Context { get; set; } + + [JilDirective("id")] + public ulong Id { get; set; } + + [JilDirective("image_url")] + public string ImageUrl { get; set; } + + [JilDirective("link_title")] + public string LinkTitle { get; set; } + + [JilDirective("title")] + public string Title { get; set; } + + [JilDirective("type")] + public string Type { get; set; } + + [JilDirective("url")] + public string Url { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/Annotation.cs b/Genius/Genius/Models/Song/Annotation.cs new file mode 100644 index 0000000..153a55a --- /dev/null +++ b/Genius/Genius/Models/Song/Annotation.cs @@ -0,0 +1,67 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class Annotation + { + [JilDirective("api_path")] + public string ApiPath { get; set; } + + [JilDirective("body")] + public Description Body { get; set; } + + [JilDirective("comment_count")] + public ulong? CommentCount { get; set; } + + [JilDirective("community")] + public bool Community { get; set; } + + [JilDirective("custom_preview")] + public object CustomPreview { get; set; } + + [JilDirective("has_voters")] + public bool HasVoters { get; set; } + + [JilDirective("id")] + public ulong? Id { get; set; } + + [JilDirective("pinned")] + public bool Pinned { get; set; } + + [JilDirective("share_url")] + public string ShareUrl { get; set; } + + [JilDirective("source")] + public object Source { get; set; } + + [JilDirective("state")] + public string State { get; set; } + + [JilDirective("url")] + public string Url { get; set; } + + [JilDirective("verified")] + public bool Verified { get; set; } + + [JilDirective("votes_total")] + public ulong? VotesTotal { get; set; } + + [JilDirective("current_user_metadata")] + public AnnotationCurrentUserMetadata CurrentUserMetadata { get; set; } + + [JilDirective("authors")] + public List Authors { get; set; } + + [JilDirective("cosigned_by")] + public List CosignedBy { get; set; } + + [JilDirective("rejection_comment")] + public object RejectionComment { get; set; } + + [JilDirective("verified_by")] + public object VerifiedBy { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/AnnotationCurrentUserMetadata.cs b/Genius/Genius/Models/Song/AnnotationCurrentUserMetadata.cs new file mode 100644 index 0000000..b6e1e00 --- /dev/null +++ b/Genius/Genius/Models/Song/AnnotationCurrentUserMetadata.cs @@ -0,0 +1,20 @@ +using Jil; +using System.Collections.Generic; + +namespace Genius.Models.Song +{ + public class AnnotationCurrentUserMetadata + { + [JilDirective("permissions")] + public List Permissions { get; set; } + + [JilDirective("excluded_permissions")] + public List ExcludedPermissions { get; set; } + + [JilDirective("interactions")] + public Interactions Interactions { get; set; } + + [JilDirective("iq_by_action")] + public IqByAction IqByAction { get; set; } + } +} \ No newline at end of file diff --git a/Genius/Genius/Models/Song/ClientTimestamps.cs b/Genius/Genius/Models/Song/ClientTimestamps.cs new file mode 100644 index 0000000..0921c3b --- /dev/null +++ b/Genius/Genius/Models/Song/ClientTimestamps.cs @@ -0,0 +1,13 @@ +using Jil; + +namespace Genius.Models.Song +{ + public class ClientTimestamps + { + [JilDirective("updated_by_human_at")] + public ulong? UpdatedByHumanAt { get; set; } + + [JilDirective("lyrics_updated_at")] + public ulong? LyricsUpdatedAt { get; set; } + } +} \ No newline at end of file diff --git a/Genius/Genius/Models/Song/CustomerPerformance.cs b/Genius/Genius/Models/Song/CustomerPerformance.cs new file mode 100644 index 0000000..0a0df60 --- /dev/null +++ b/Genius/Genius/Models/Song/CustomerPerformance.cs @@ -0,0 +1,16 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class CustomPerformance + { + [JilDirective("label")] + public string Label { get; set; } + + [JilDirective("artists")] + public List Artists { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/Description.cs b/Genius/Genius/Models/Song/Description.cs new file mode 100644 index 0000000..b27c0e6 --- /dev/null +++ b/Genius/Genius/Models/Song/Description.cs @@ -0,0 +1,13 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class Description + { + [JilDirective("html")] + public string Html { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/DescriptionAnnotation.cs b/Genius/Genius/Models/Song/DescriptionAnnotation.cs new file mode 100644 index 0000000..b881b72 --- /dev/null +++ b/Genius/Genius/Models/Song/DescriptionAnnotation.cs @@ -0,0 +1,55 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class DescriptionAnnotation + { + [JilDirective("_type")] + public string Type { get; set; } + + [JilDirective("annotator_id")] + public ulong? AnnotatorId { get; set; } + + [JilDirective("annotator_login")] + public string AnnotatorLogin { get; set; } + + [JilDirective("api_path")] + public string ApiPath { get; set; } + + [JilDirective("classification")] + public string Classification { get; set; } + + [JilDirective("fragment")] + public string Fragment { get; set; } + + [JilDirective("id")] + public ulong? Id { get; set; } + + [JilDirective("is_description")] + public bool IsDescription { get; set; } + + [JilDirective("path")] + public string Path { get; set; } + + [JilDirective("range")] + public Range Range { get; set; } + + [JilDirective("song_id")] + public ulong? SongId { get; set; } + + [JilDirective("url")] + public string Url { get; set; } + + [JilDirective("verified_annotator_ids")] + public List VerifiedAnnotatorIds { get; set; } + + [JilDirective("annotatable")] + public Annotatable Annotatable { get; set; } + + [JilDirective("annotations")] + public List Annotations { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/Interactions.cs b/Genius/Genius/Models/Song/Interactions.cs new file mode 100644 index 0000000..d7834a9 --- /dev/null +++ b/Genius/Genius/Models/Song/Interactions.cs @@ -0,0 +1,19 @@ +using Jil; + +namespace Genius.Models.Song +{ + public class Interactions + { + [JilDirective("cosign")] + public bool Cosign { get; set; } + + [JilDirective("pyong")] + public bool Pyong { get; set; } + + [JilDirective("vote")] + public object Vote { get; set; } + + [JilDirective("following")] + public bool Following { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/IqByAction.cs b/Genius/Genius/Models/Song/IqByAction.cs new file mode 100644 index 0000000..9dd1d7b --- /dev/null +++ b/Genius/Genius/Models/Song/IqByAction.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class IqByAction + { + } +} diff --git a/Genius/Genius/Models/Song/Range.cs b/Genius/Genius/Models/Song/Range.cs new file mode 100644 index 0000000..51f88ed --- /dev/null +++ b/Genius/Genius/Models/Song/Range.cs @@ -0,0 +1,13 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class Range + { + [JilDirective("content")] + public string Content { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/Song.cs b/Genius/Genius/Models/Song/Song.cs index 638d40f..b310b8f 100644 --- a/Genius/Genius/Models/Song/Song.cs +++ b/Genius/Genius/Models/Song/Song.cs @@ -6,109 +6,123 @@ namespace Genius.Models.Song { - public class Song - { - [JilDirective(Name = "annotation_count")] - public ulong AnnotationCount { get; set; } + public class Song + { + [JilDirective("annotation_count")] + public ulong? AnnotationCount { get; set; } - [JilDirective(Name = "api_path")] public string ApiPath { get; set; } + [JilDirective("api_path")] + public string ApiPath { get; set; } - [JilDirective(Name = "apple_music_id")] - public string AppleMusicId { get; set; } + [JilDirective("apple_music_id")] + public string AppleMusicId { get; set; } - [JilDirective(Name = "apple_music_player_url")] - public string AppleMusicPlayerUrl { get; set; } + [JilDirective("apple_music_player_url")] + public string AppleMusicPlayerUrl { get; set; } - [JilDirective(Name = "description")] public HtmlFormat Description { get; set; } + [JilDirective("description")] + public Description Description { get; set; } - [JilDirective(Name = "embed_content")] public string EmbedContent { get; set; } + [JilDirective("embed_content")] + public string EmbedContent { get; set; } - [JilDirective(Name = "featured_video")] - public bool FeaturedVideo { get; set; } + [JilDirective("featured_video")] + public bool FeaturedVideo { get; set; } - [JilDirective(Name = "full_title")] public string FullTitle { get; set; } + [JilDirective("full_title")] + public string FullTitle { get; set; } - [JilDirective(Name = "header_image_thumbnail_url")] - public string HeaderImageThumbnailUrl { get; set; } + [JilDirective("header_image_thumbnail_url")] + public string HeaderImageThumbnailUrl { get; set; } - [JilDirective(Name = "header_image_url")] - public string HeaderImageUrl { get; set; } + [JilDirective("header_image_url")] + public string HeaderImageUrl { get; set; } - [JilDirective(Name = "id")] public ulong Id { get; set; } + [JilDirective("id")] + public ulong? Id { get; set; } - [JilDirective(Name = "lyrics_owner_id")] - public ulong LyricsOwnerId { get; set; } + [JilDirective("lyrics_owner_id")] + public ulong? LyricsOwnerId { get; set; } - [JilDirective(Name = "lyrics_place_holder_reason")] - public string LyricsPlaceHolderReason { get; set; } + [JilDirective("lyrics_placeholder_reason")] + public object LyricsPlaceholderReason { get; set; } - [JilDirective(Name = "lyrics_state")] public string LyricsState { get; set; } + [JilDirective("lyrics_state")] + public string LyricsState { get; set; } - [JilDirective(Name = "path")] public string Path { get; set; } + [JilDirective("path")] + public string Path { get; set; } - [JilDirective(Name = "pyongs_count")] public ulong? PyongsCount { get; set; } + [JilDirective("pyongs_count")] + public ulong? PyongsCount { get; set; } - [JilDirective(Name = "recording_location")] - public string RecordingLocation { get; set; } + [JilDirective("recording_location")] + public object RecordingLocation { get; set; } - [JilDirective(Name = "release_date")] public string ReleaseDate { get; set; } + [JilDirective("release_date")] + public string ReleaseDate { get; set; } - [JilDirective(Name = "release_date_for_display")] - public string ReleaseDateForDisplay { get; set; } + [JilDirective("release_date_for_display")] + public string ReleaseDateForDisplay { get; set; } - [JilDirective(Name = "song_art_image_thumbnail_url")] - public string SongArtImageThumbnailUrl { get; set; } + [JilDirective("song_art_image_thumbnail_url")] + public string SongArtImageThumbnailUrl { get; set; } - [JilDirective(Name = "song_art_image_url")] - public string SongArtImageUrl { get; set; } + [JilDirective("song_art_image_url")] + public string SongArtImageUrl { get; set; } - [JilDirective(Name = "stats")] public SongStats Stats { get; set; } + [JilDirective("stats")] + public Stats Stats { get; set; } - [JilDirective(Name = "title")] public string Title { get; set; } + [JilDirective("title")] + public string Title { get; set; } - [JilDirective(Name = "title_with_featured")] - public string TitleWithFeatured { get; set; } + [JilDirective("title_with_featured")] + public string TitleWithFeatured { get; set; } - [JilDirective(Name = "url")] public string Url { get; set; } + [JilDirective("url")] + public string Url { get; set; } - [JilDirective(Name = "current_user_metadata")] - public UserMetadata CurrentUserMetadata { get; set; } + [JilDirective("current_user_metadata")] + public SongCurrentUserMetadata CurrentUserMetadata { get; set; } - [JilDirective(Name = "album")] public Album Album { get; set; } + [JilDirective("album")] + public object Album { get; set; } - [JilDirective(Name = "custom_performances")] - public List CustomPerformances { get; set; } + [JilDirective("custom_performances")] + public List CustomPerformances { get; set; } - [JilDirective(Name = "description_annotation")] - public Referent.Referent DescriptionAnnotation { get; set; } + [JilDirective("description_annotation")] + public DescriptionAnnotation DescriptionAnnotation { get; set; } - [JilDirective(Name = "featured_artists")] - public List FeaturedArtists { get; set; } + [JilDirective("featured_artists")] + public List FeaturedArtists { get; set; } - [JilDirective(Name = "lyrics_marked_complete_by")] - public User.User LyricsMarkedCompleteBy { get; set; } + [JilDirective("lyrics_marked_complete_by")] + public object LyricsMarkedCompleteBy { get; set; } - [JilDirective(Name = "media")] public List Media { get; set; } + [JilDirective("media")] + public List Media { get; set; } - [JilDirective(Name = "primary_artist")] - public Artist.Artist PrimaryArtist { get; set; } + [JilDirective("primary_artist")] + public Artist.Artist PrimaryArtist { get; set; } - [JilDirective(Name = "producer_artists")] - public List ProducerArtists { get; set; } + [JilDirective("producer_artists")] + public List ProducerArtists { get; set; } - [JilDirective(Name = "song_relationships")] - public List SongRelationships { get; set; } + [JilDirective("song_relationships")] + public List SongRelationships { get; set; } - [JilDirective(Name = "verified_annotations_by")] - public List VerifiedAnnotationsBy { get; set; } + [JilDirective("verified_annotations_by")] + public List VerifiedAnnotationsBy { get; set; } - [JilDirective(Name = "verified_contributors")] - public List VerifiedContributors { get; set; } + [JilDirective("verified_contributors")] + public List VerifiedContributors { get; set; } - [JilDirective(Name = "verified_lyrics_by")] - public List VerifiedLyricsBy { get; set; } + [JilDirective("verified_lyrics_by")] + public List VerifiedLyricsBy { get; set; } - [JilDirective(Name = "writer_artists")] - public List WriterArtists { get; set; } - } + [JilDirective("writer_artists")] + public List WriterArtists { get; set; } + } } \ No newline at end of file diff --git a/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs b/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs new file mode 100644 index 0000000..d82b2f7 --- /dev/null +++ b/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs @@ -0,0 +1,25 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class SongCurrentUserMetadata + { + [JilDirective("permissions")] + public List Permissions { get; set; } + + [JilDirective("excluded_permissions")] + public List ExcludedPermissions { get; set; } + + [JilDirective("interactions")] + public Interactions Interactions { get; set; } + + [JilDirective("relationships")] + public IqByAction Relationships { get; set; } + + [JilDirective("iq_by_action")] + public IqByAction IqByAction { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/Stats.cs b/Genius/Genius/Models/Song/Stats.cs new file mode 100644 index 0000000..b52a6d7 --- /dev/null +++ b/Genius/Genius/Models/Song/Stats.cs @@ -0,0 +1,28 @@ +using Jil; + +namespace Genius.Models.Song +{ + public class Stats + { + [JilDirective("accepted_annotations")] + public ulong? AcceptedAnnotations { get; set; } + + [JilDirective("contributors")] + public ulong? Contributors { get; set; } + + [JilDirective("iq_earners")] + public ulong? IqEarners { get; set; } + + [JilDirective("transcribers")] + public ulong? Transcribers { get; set; } + + [JilDirective("unreviewed_annotations")] + public ulong? UnreviewedAnnotations { get; set; } + + [JilDirective("verified_annotations")] + public ulong? VerifiedAnnotations { get; set; } + + [JilDirective("hot")] + public bool Hot { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs b/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs new file mode 100644 index 0000000..19f4a85 --- /dev/null +++ b/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs @@ -0,0 +1,43 @@ +using Jil; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Genius.Models.Song +{ + public class VerifiedAnnotationsBy + { + [JilDirective("api_path")] + public string ApiPath { get; set; } + + [JilDirective("avatar")] + public Avatar Avatar { get; set; } + + [JilDirective("header_image_url")] + public string HeaderImageUrl { get; set; } + + [JilDirective("human_readable_role_for_display")] + public string HumanReadableRoleForDisplay { get; set; } + + [JilDirective("id")] + public ulong? Id { get; set; } + + [JilDirective("iq")] + public ulong? Iq { get; set; } + + [JilDirective("login")] + public string Login { get; set; } + + [JilDirective("name")] + public string Name { get; set; } + + [JilDirective("role_for_display")] + public string RoleForDisplay { get; set; } + + [JilDirective("url")] + public string Url { get; set; } + + [JilDirective("current_user_metadata")] + public VerifiedAnnotationsByCurrentUserMetadata CurrentUserMetadata { get; set; } + } +} diff --git a/Genius/Genius/Models/Song/VerifiedAnnotationsByCurrentUserMetadata.cs b/Genius/Genius/Models/Song/VerifiedAnnotationsByCurrentUserMetadata.cs new file mode 100644 index 0000000..b298b07 --- /dev/null +++ b/Genius/Genius/Models/Song/VerifiedAnnotationsByCurrentUserMetadata.cs @@ -0,0 +1,17 @@ +using Jil; +using System.Collections.Generic; + +namespace Genius.Models.Song +{ + public class VerifiedAnnotationsByCurrentUserMetadata + { + [JilDirective("permissions")] + public List Permissions { get; set; } + + [JilDirective("excluded_permissions")] + public List ExcludedPermissions { get; set; } + + [JilDirective("interactions")] + public Interactions Interactions { get; set; } + } +} \ No newline at end of file diff --git a/Genius/Genius/Models/Song/VerifiedContributor.cs b/Genius/Genius/Models/Song/VerifiedContributor.cs new file mode 100644 index 0000000..ed9d880 --- /dev/null +++ b/Genius/Genius/Models/Song/VerifiedContributor.cs @@ -0,0 +1,19 @@ +// ReSharper disable ClassNeverInstantiated.Global + +using Jil; +using System.Collections.Generic; + +namespace Genius.Models.Song +{ + public class VerifiedContributor + { + [JilDirective("contributions")] + public List Contributions { get; set; } + + [JilDirective("artist")] + public Artist.Artist Artist { get; set; } + + [JilDirective("user")] + public VerifiedAnnotationsBy User { get; set; } + } +} \ No newline at end of file diff --git a/Genius/Genius/Models/User/User.cs b/Genius/Genius/Models/User/User.cs index fa91fdb..f5c6aba 100644 --- a/Genius/Genius/Models/User/User.cs +++ b/Genius/Genius/Models/User/User.cs @@ -6,7 +6,7 @@ namespace Genius.Models.User { public class User { - [JilDirective(Name="about_me")] public HtmlFormat AboutMe { get; set; } + [JilDirective(Name="about_me")] public string AboutMe { get; set; } [JilDirective(Name = "api_path")] public string ApiPath { get; set; } @@ -21,10 +21,10 @@ public class User [JilDirective(Name = "email")] public string Email { get; set; } [JilDirective(Name = "followed_users_count")] - public ulong FollowedUsersCount { get; set; } + public ulong? FollowedUsersCount { get; set; } [JilDirective(Name = "followers_count")] - public ulong FollowersCount { get; set; } + public ulong? FollowersCount { get; set; } [JilDirective(Name = "header_image_url")] public string HeaderImageUrl { get; set; } @@ -32,11 +32,11 @@ public class User [JilDirective(Name = "human_readable_role_for_display")] public string HumanReadableRoleForDisplay { get; set; } - [JilDirective(Name = "id")] public ulong Id { get; set; } + [JilDirective(Name = "id")] public ulong? Id { get; set; } [JilDirective(Name = "identities")] public List Identities { get; set; } - [JilDirective(Name = "iq")] public ulong Iq { get; set; } + [JilDirective(Name = "iq")] public ulong? Iq { get; set; } [JilDirective(Name = "iq_for_display")] public string IqForDisplay { get; set; } @@ -56,16 +56,16 @@ public class User public List RolesForDisplay { get; set; } [JilDirective(Name = "unread_groups_inbox_count")] - public ulong UnreadGroupsInboxCount { get; set; } + public ulong? UnreadGroupsInboxCount { get; set; } [JilDirective(Name = "unread_main_activity_inbox_count")] - public ulong UnreadMainActivityInboxCount { get; set; } + public ulong? UnreadMainActivityInboxCount { get; set; } [JilDirective(Name = "unread_messages_count")] - public ulong UnreadMessagesCount { get; set; } + public ulong? UnreadMessagesCount { get; set; } [JilDirective(Name = "unread_news_feed_inbox_count")] - public ulong UnreadNewsFeedInboxCount { get; set; } + public ulong? UnreadNewsFeedInboxCount { get; set; } [JilDirective(Name = "url")] public string Url { get; set; } From ace050c2f9e60501475d86021fdbd1e7bfbe9604 Mon Sep 17 00:00:00 2001 From: Omar Pani Date: Sun, 7 Feb 2021 18:30:59 +0100 Subject: [PATCH 2/4] Improved unit testing --- Tests/Tests/AnnotationClientTests.cs | 37 ++++++++++++++++ Tests/Tests/ArtistClientTests.cs | 44 +++++++++++++++++++ Tests/Tests/GeniusTests.cs | 35 --------------- Tests/Tests/Models/TestInputData.cs | 33 ++++++++++++++ Tests/Tests/SearchClientTests.cs | 35 +++++++++++++++ Tests/Tests/SongClientTests.cs | 35 +++++++++++++++ Tests/Tests/TestInputData.json | 6 +++ Tests/Tests/Tests.csproj | 9 ++++ .../Utilities/GeniusClientInitializer.cs | 18 ++++++++ 9 files changed, 217 insertions(+), 35 deletions(-) create mode 100644 Tests/Tests/AnnotationClientTests.cs create mode 100644 Tests/Tests/ArtistClientTests.cs delete mode 100644 Tests/Tests/GeniusTests.cs create mode 100644 Tests/Tests/Models/TestInputData.cs create mode 100644 Tests/Tests/SearchClientTests.cs create mode 100644 Tests/Tests/SongClientTests.cs create mode 100644 Tests/Tests/TestInputData.json create mode 100644 Tests/Tests/Utilities/GeniusClientInitializer.cs diff --git a/Tests/Tests/AnnotationClientTests.cs b/Tests/Tests/AnnotationClientTests.cs new file mode 100644 index 0000000..456a68a --- /dev/null +++ b/Tests/Tests/AnnotationClientTests.cs @@ -0,0 +1,37 @@ +using Genius; +using Genius.Models.Response; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Text; +using System.Threading.Tasks; +using Tests.Models; +using Tests.Utilities; + +namespace Tests +{ + [TestClass] + public class AnnotationClientTests + { + private static GeniusClient _geniusClient; + private static TestInputData _inputData; + + [ClassInitialize()] + public static void ClassInit(TestContext context) + { + _geniusClient = GeniusClientInitializer.GetClient(); + _inputData = TestInputData.GetFromJsonFile(); + } + + [TestMethod] + public async Task GetAnnotation() + { + foreach(ulong annotationId in _inputData.Annotations) + { + AnnotationResponse annotationResponse = await _geniusClient.AnnotationClient.GetAnnotation(annotationId); + Assert.IsNotNull(annotationResponse); + } + } + } +} diff --git a/Tests/Tests/ArtistClientTests.cs b/Tests/Tests/ArtistClientTests.cs new file mode 100644 index 0000000..3c91741 --- /dev/null +++ b/Tests/Tests/ArtistClientTests.cs @@ -0,0 +1,44 @@ +using Genius; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Configuration; +using System.Threading.Tasks; +using Tests.Models; +using Tests.Utilities; + +namespace Tests +{ + [TestClass] + public class ArtistClientTests + { + private static GeniusClient _geniusClient; + private static TestInputData _inputData; + + [ClassInitialize()] + public static void ClassInit(TestContext context) + { + _geniusClient = GeniusClientInitializer.GetClient(); + _inputData = TestInputData.GetFromJsonFile(); + } + + [TestMethod] + public async Task GetArtistsSongs_NotExistingPage() + { + foreach (ulong artistId in _inputData.Artists) + { + var songs = await _geniusClient.ArtistClient.GetArtistsSongs(artistId, sort: "title", perPage: "10", page: "3000"); + Assert.IsFalse(songs.Response.NextPage.HasValue); + } + } + + [TestMethod] + public async Task GetArtistsSongs_ExistingPage() + { + foreach (ulong artistId in _inputData.Artists) + { + var songs = await _geniusClient.ArtistClient.GetArtistsSongs(artistId, sort: "title", perPage: "10", page: "1"); + Assert.IsTrue(songs.Response.NextPage.HasValue); + Assert.IsTrue(songs.Response.Songs.Count > 0); + } + } + } +} diff --git a/Tests/Tests/GeniusTests.cs b/Tests/Tests/GeniusTests.cs deleted file mode 100644 index f8d1bd9..0000000 --- a/Tests/Tests/GeniusTests.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Genius; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Configuration; -using System.Threading.Tasks; - -namespace Tests -{ - [TestClass] - public class GeniusTests - { - private static GeniusClient _geniusClient; - - [ClassInitialize()] - public static void ClassInit(TestContext context) - { - string apiKey = ConfigurationManager.AppSettings["API_KEY"]?.ToString(); - _geniusClient = new GeniusClient(apiKey); - } - - [TestMethod] - public async Task SearchForArtistsSongs_NotExistingPage() - { - var songs = await _geniusClient.ArtistClient.GetArtistsSongs(16775, sort: "title", perPage: "10", page: "3000"); - Assert.IsFalse(songs.Response.NextPage.HasValue); - } - - [TestMethod] - public async Task SearchForArtistsSongs_ExistingPage() - { - var songs = await _geniusClient.ArtistClient.GetArtistsSongs(16775, sort: "title", perPage: "10", page: "1"); - Assert.IsTrue(songs.Response.NextPage.HasValue); - Assert.IsTrue(songs.Response.Songs.Count > 0); - } - } -} diff --git a/Tests/Tests/Models/TestInputData.cs b/Tests/Tests/Models/TestInputData.cs new file mode 100644 index 0000000..86b7459 --- /dev/null +++ b/Tests/Tests/Models/TestInputData.cs @@ -0,0 +1,33 @@ +using Jil; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +namespace Tests.Models +{ + public class TestInputData + { + [JilDirective("artists")] + public List Artists { get; set; } + + [JilDirective("songs")] + public List Songs { get; set; } + + [JilDirective("searchQueries")] + public List SearchQueries { get; set; } + + [JilDirective("annotations")] + public List Annotations { get; set; } + + public static TestInputData GetFromJsonFile() + { + string executingAssembly = Assembly.GetExecutingAssembly().Location; + string executingPath = Path.GetDirectoryName(executingAssembly); + string jsonPath = Path.Combine(executingPath, "TestInputData.json"); + + string jsonContent = File.ReadAllText(jsonPath); + + return JSON.Deserialize(jsonContent); + } + } +} diff --git a/Tests/Tests/SearchClientTests.cs b/Tests/Tests/SearchClientTests.cs new file mode 100644 index 0000000..2ea3bd1 --- /dev/null +++ b/Tests/Tests/SearchClientTests.cs @@ -0,0 +1,35 @@ +using Genius; +using Genius.Models.Response; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Collections.Generic; +using System.Configuration; +using System.Threading.Tasks; +using Tests.Models; +using Tests.Utilities; + +namespace Tests +{ + [TestClass] + public class SearchClientTests + { + private static GeniusClient _geniusClient; + private static TestInputData _inputData; + + [ClassInitialize()] + public static void ClassInit(TestContext context) + { + _geniusClient = GeniusClientInitializer.GetClient(); + _inputData = TestInputData.GetFromJsonFile(); + } + + [TestMethod] + public async Task Search() + { + foreach (string query in _inputData.SearchQueries) + { + SearchResponse searchResponse = await _geniusClient.SearchClient.Search(query); + Assert.IsNotNull(searchResponse.Response.Hits); + } + } + } +} diff --git a/Tests/Tests/SongClientTests.cs b/Tests/Tests/SongClientTests.cs new file mode 100644 index 0000000..5c02a50 --- /dev/null +++ b/Tests/Tests/SongClientTests.cs @@ -0,0 +1,35 @@ +using Genius; +using Genius.Models.Response; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Collections.Generic; +using System.Configuration; +using System.Threading.Tasks; +using Tests.Models; +using Tests.Utilities; + +namespace Tests +{ + [TestClass] + public class SongClientTests + { + private static GeniusClient _geniusClient; + private static TestInputData _inputData; + + [ClassInitialize()] + public static void ClassInit(TestContext context) + { + _geniusClient = GeniusClientInitializer.GetClient(); + _inputData = TestInputData.GetFromJsonFile(); + } + + [TestMethod] + public async Task GetSongs() + { + foreach (ulong songId in _inputData.Songs) + { + SongResponse song = await _geniusClient.SongClient.GetSong(songId); + Assert.IsNotNull(song.Response.Song); + } + } + } +} diff --git a/Tests/Tests/TestInputData.json b/Tests/Tests/TestInputData.json new file mode 100644 index 0000000..72536ce --- /dev/null +++ b/Tests/Tests/TestInputData.json @@ -0,0 +1,6 @@ +{ + "artists": [ 16775 ], + "songs": [ 6267625, 5576398 ], + "searchQueries": [ "Kendrick Lamar" ], + "annotations": [ 10225840 ] +} \ No newline at end of file diff --git a/Tests/Tests/Tests.csproj b/Tests/Tests/Tests.csproj index 2d8c6a4..5b24f82 100644 --- a/Tests/Tests/Tests.csproj +++ b/Tests/Tests/Tests.csproj @@ -18,4 +18,13 @@ + + + Always + + + Always + + + diff --git a/Tests/Tests/Utilities/GeniusClientInitializer.cs b/Tests/Tests/Utilities/GeniusClientInitializer.cs new file mode 100644 index 0000000..ee1537d --- /dev/null +++ b/Tests/Tests/Utilities/GeniusClientInitializer.cs @@ -0,0 +1,18 @@ +using Genius; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Text; + +namespace Tests.Utilities +{ + public static class GeniusClientInitializer + { + public static GeniusClient GetClient() + { + Configuration configuration = ConfigurationManager.OpenExeConfiguration("Tests.dll"); + string apiKey = configuration.AppSettings.Settings["API_KEY"]?.Value; + return new GeniusClient(apiKey); + } + } +} From 39354d7c033450e15f1fc312177feab3a5c307d9 Mon Sep 17 00:00:00 2001 From: Omar Pani Date: Sun, 7 Feb 2021 18:33:44 +0100 Subject: [PATCH 3/4] Removed unused usings --- Genius/Genius/Core/IGeniusClient.cs | 6 ++---- Genius/Genius/Http/IGeniusRestClient.cs | 11 +++++------ Genius/Genius/Models/Song/Annotatable.cs | 3 --- Genius/Genius/Models/Song/Annotation.cs | 2 -- Genius/Genius/Models/Song/CustomerPerformance.cs | 2 -- Genius/Genius/Models/Song/Description.cs | 3 --- Genius/Genius/Models/Song/DescriptionAnnotation.cs | 2 -- Genius/Genius/Models/Song/IqByAction.cs | 6 +----- Genius/Genius/Models/Song/Range.cs | 3 --- Genius/Genius/Models/Song/Song.cs | 1 - Genius/Genius/Models/Song/SongCurrentUserMetadata.cs | 2 -- Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs | 3 --- Genius/Genius/Models/WebPage.cs | 3 +-- Tests/Tests/AnnotationClientTests.cs | 4 ---- Tests/Tests/ArtistClientTests.cs | 1 - Tests/Tests/SearchClientTests.cs | 2 -- Tests/Tests/SongClientTests.cs | 2 -- Tests/Tests/Utilities/GeniusClientInitializer.cs | 3 --- 18 files changed, 9 insertions(+), 50 deletions(-) diff --git a/Genius/Genius/Core/IGeniusClient.cs b/Genius/Genius/Core/IGeniusClient.cs index 8d752c4..f4b04af 100644 --- a/Genius/Genius/Core/IGeniusClient.cs +++ b/Genius/Genius/Core/IGeniusClient.cs @@ -1,8 +1,6 @@ -using Genius.Clients.Interfaces; - -namespace Genius.Core +namespace Genius.Core { - public interface IGeniusClient + public interface IGeniusClient { } diff --git a/Genius/Genius/Http/IGeniusRestClient.cs b/Genius/Genius/Http/IGeniusRestClient.cs index 2be728f..67b56f6 100644 --- a/Genius/Genius/Http/IGeniusRestClient.cs +++ b/Genius/Genius/Http/IGeniusRestClient.cs @@ -1,12 +1,11 @@ -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace Genius.Http { - /// - /// Also see: https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests - /// - public interface IGeniusRestClient + /// + /// Also see: https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests + /// + public interface IGeniusRestClient { /// /// Sends GET request to endpoint. diff --git a/Genius/Genius/Models/Song/Annotatable.cs b/Genius/Genius/Models/Song/Annotatable.cs index dd79622..75ca784 100644 --- a/Genius/Genius/Models/Song/Annotatable.cs +++ b/Genius/Genius/Models/Song/Annotatable.cs @@ -1,7 +1,4 @@ using Jil; -using System; -using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/Annotation.cs b/Genius/Genius/Models/Song/Annotation.cs index 153a55a..c5370f5 100644 --- a/Genius/Genius/Models/Song/Annotation.cs +++ b/Genius/Genius/Models/Song/Annotation.cs @@ -1,7 +1,5 @@ using Jil; -using System; using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/CustomerPerformance.cs b/Genius/Genius/Models/Song/CustomerPerformance.cs index 0a0df60..49355f7 100644 --- a/Genius/Genius/Models/Song/CustomerPerformance.cs +++ b/Genius/Genius/Models/Song/CustomerPerformance.cs @@ -1,7 +1,5 @@ using Jil; -using System; using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/Description.cs b/Genius/Genius/Models/Song/Description.cs index b27c0e6..c25018d 100644 --- a/Genius/Genius/Models/Song/Description.cs +++ b/Genius/Genius/Models/Song/Description.cs @@ -1,7 +1,4 @@ using Jil; -using System; -using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/DescriptionAnnotation.cs b/Genius/Genius/Models/Song/DescriptionAnnotation.cs index b881b72..b993f41 100644 --- a/Genius/Genius/Models/Song/DescriptionAnnotation.cs +++ b/Genius/Genius/Models/Song/DescriptionAnnotation.cs @@ -1,7 +1,5 @@ using Jil; -using System; using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/IqByAction.cs b/Genius/Genius/Models/Song/IqByAction.cs index 9dd1d7b..2fdb54b 100644 --- a/Genius/Genius/Models/Song/IqByAction.cs +++ b/Genius/Genius/Models/Song/IqByAction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Genius.Models.Song +namespace Genius.Models.Song { public class IqByAction { diff --git a/Genius/Genius/Models/Song/Range.cs b/Genius/Genius/Models/Song/Range.cs index 51f88ed..9dc4bfe 100644 --- a/Genius/Genius/Models/Song/Range.cs +++ b/Genius/Genius/Models/Song/Range.cs @@ -1,7 +1,4 @@ using Jil; -using System; -using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/Song.cs b/Genius/Genius/Models/Song/Song.cs index b310b8f..93ec6ac 100644 --- a/Genius/Genius/Models/Song/Song.cs +++ b/Genius/Genius/Models/Song/Song.cs @@ -1,7 +1,6 @@ // ReSharper disable ClassNeverInstantiated.Global using System.Collections.Generic; -using Genius.Models.User; using Jil; namespace Genius.Models.Song diff --git a/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs b/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs index d82b2f7..889f013 100644 --- a/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs +++ b/Genius/Genius/Models/Song/SongCurrentUserMetadata.cs @@ -1,7 +1,5 @@ using Jil; -using System; using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs b/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs index 19f4a85..bf762b9 100644 --- a/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs +++ b/Genius/Genius/Models/Song/VerifiedAnnotationsBy.cs @@ -1,7 +1,4 @@ using Jil; -using System; -using System.Collections.Generic; -using System.Text; namespace Genius.Models.Song { diff --git a/Genius/Genius/Models/WebPage.cs b/Genius/Genius/Models/WebPage.cs index 5b41fa3..c7692c3 100644 --- a/Genius/Genius/Models/WebPage.cs +++ b/Genius/Genius/Models/WebPage.cs @@ -1,11 +1,10 @@ // ReSharper disable ClassNeverInstantiated.Global -using System.Collections.Generic; using Jil; namespace Genius.Models { - public class WebPage + public class WebPage { [JilDirective(Name = "api_path")] public string ApiPath { get; set; } diff --git a/Tests/Tests/AnnotationClientTests.cs b/Tests/Tests/AnnotationClientTests.cs index 456a68a..9410377 100644 --- a/Tests/Tests/AnnotationClientTests.cs +++ b/Tests/Tests/AnnotationClientTests.cs @@ -1,10 +1,6 @@ using Genius; using Genius.Models.Response; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Text; using System.Threading.Tasks; using Tests.Models; using Tests.Utilities; diff --git a/Tests/Tests/ArtistClientTests.cs b/Tests/Tests/ArtistClientTests.cs index 3c91741..f794f60 100644 --- a/Tests/Tests/ArtistClientTests.cs +++ b/Tests/Tests/ArtistClientTests.cs @@ -1,6 +1,5 @@ using Genius; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Configuration; using System.Threading.Tasks; using Tests.Models; using Tests.Utilities; diff --git a/Tests/Tests/SearchClientTests.cs b/Tests/Tests/SearchClientTests.cs index 2ea3bd1..7b61006 100644 --- a/Tests/Tests/SearchClientTests.cs +++ b/Tests/Tests/SearchClientTests.cs @@ -1,8 +1,6 @@ using Genius; using Genius.Models.Response; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Configuration; using System.Threading.Tasks; using Tests.Models; using Tests.Utilities; diff --git a/Tests/Tests/SongClientTests.cs b/Tests/Tests/SongClientTests.cs index 5c02a50..034ee13 100644 --- a/Tests/Tests/SongClientTests.cs +++ b/Tests/Tests/SongClientTests.cs @@ -1,8 +1,6 @@ using Genius; using Genius.Models.Response; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Configuration; using System.Threading.Tasks; using Tests.Models; using Tests.Utilities; diff --git a/Tests/Tests/Utilities/GeniusClientInitializer.cs b/Tests/Tests/Utilities/GeniusClientInitializer.cs index ee1537d..87d6987 100644 --- a/Tests/Tests/Utilities/GeniusClientInitializer.cs +++ b/Tests/Tests/Utilities/GeniusClientInitializer.cs @@ -1,8 +1,5 @@ using Genius; -using System; -using System.Collections.Generic; using System.Configuration; -using System.Text; namespace Tests.Utilities { From e4ef89af17ee3a1271f1275b61b988da7ef33b5b Mon Sep 17 00:00:00 2001 From: Omar Pani Date: Sun, 7 Feb 2021 18:36:07 +0100 Subject: [PATCH 4/4] Improved unit tests data --- Tests/Tests/TestInputData.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Tests/TestInputData.json b/Tests/Tests/TestInputData.json index 72536ce..e033859 100644 --- a/Tests/Tests/TestInputData.json +++ b/Tests/Tests/TestInputData.json @@ -1,6 +1,6 @@ { "artists": [ 16775 ], - "songs": [ 6267625, 5576398 ], - "searchQueries": [ "Kendrick Lamar" ], + "songs": [ 6267625, 5576398, 3144449, 3464996, 3675807 ], + "searchQueries": [ "Kendrick Lamar", "Drake", "J.Cole", "Foo Fighters" ], "annotations": [ 10225840 ] } \ No newline at end of file