From c672b6158bc1bc9f0ea803cad6a251802acbda29 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Tue, 16 Jun 2020 20:48:34 +0200 Subject: [PATCH] Added test case for serializing with PlaylistElementConverter --- .../Models/PlayableItemConverterTest.cs | 22 +++++++++++++++++++ ...tConverter.cs => PlayableItemConverter.cs} | 0 2 files changed, 22 insertions(+) create mode 100644 SpotifyAPI.Web.Tests/Models/PlayableItemConverterTest.cs rename SpotifyAPI.Web/Models/Converters/{PlaylistElementConverter.cs => PlayableItemConverter.cs} (100%) diff --git a/SpotifyAPI.Web.Tests/Models/PlayableItemConverterTest.cs b/SpotifyAPI.Web.Tests/Models/PlayableItemConverterTest.cs new file mode 100644 index 00000000..27d1bf19 --- /dev/null +++ b/SpotifyAPI.Web.Tests/Models/PlayableItemConverterTest.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace SpotifyAPI.Web.Tests +{ + [TestFixture] + public class PPlayableItemConverterTest + { + [Test] + public void PlayableItemConverter_CanSerialize() + { + var context = new CurrentlyPlayingContext { Item = new FullTrack() }; + + Assert.DoesNotThrow(() => + { + var serialized = JsonConvert.SerializeObject(context); + }); + } + } +} diff --git a/SpotifyAPI.Web/Models/Converters/PlaylistElementConverter.cs b/SpotifyAPI.Web/Models/Converters/PlayableItemConverter.cs similarity index 100% rename from SpotifyAPI.Web/Models/Converters/PlaylistElementConverter.cs rename to SpotifyAPI.Web/Models/Converters/PlayableItemConverter.cs