From a24b667eb94d4cdf96d78cf3c1e85ca693b0b573 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Sun, 1 Apr 2018 18:58:26 +0200 Subject: [PATCH] Added Tests for Util class and some cleanup --- SpotifyAPI.Tests/SpotifyAPI.Tests.csproj | 3 ++- SpotifyAPI.Tests/SpotifyUriTest.cs | 9 ++------- .../{TestClass.cs => SpotifyWebAPITest.cs} | 2 +- SpotifyAPI.Tests/UtilTest.cs | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+), 9 deletions(-) rename SpotifyAPI.Tests/{TestClass.cs => SpotifyWebAPITest.cs} (98%) create mode 100644 SpotifyAPI.Tests/UtilTest.cs diff --git a/SpotifyAPI.Tests/SpotifyAPI.Tests.csproj b/SpotifyAPI.Tests/SpotifyAPI.Tests.csproj index 528cecaf..51203cdd 100644 --- a/SpotifyAPI.Tests/SpotifyAPI.Tests.csproj +++ b/SpotifyAPI.Tests/SpotifyAPI.Tests.csproj @@ -56,8 +56,9 @@ - + + diff --git a/SpotifyAPI.Tests/SpotifyUriTest.cs b/SpotifyAPI.Tests/SpotifyUriTest.cs index 395173a3..9326a626 100644 --- a/SpotifyAPI.Tests/SpotifyUriTest.cs +++ b/SpotifyAPI.Tests/SpotifyUriTest.cs @@ -1,16 +1,11 @@ -using Moq; -using Newtonsoft.Json; -using NUnit.Framework; -using SpotifyAPI.Local; +using NUnit.Framework; using SpotifyAPI.Local.Models; using SpotifyAPI.Local.Enums; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; namespace SpotifyAPI.Tests { + [TestFixture] public class SpotifyUriTest { [Test] diff --git a/SpotifyAPI.Tests/TestClass.cs b/SpotifyAPI.Tests/SpotifyWebAPITest.cs similarity index 98% rename from SpotifyAPI.Tests/TestClass.cs rename to SpotifyAPI.Tests/SpotifyWebAPITest.cs index eaf99f49..a07c585b 100644 --- a/SpotifyAPI.Tests/TestClass.cs +++ b/SpotifyAPI.Tests/SpotifyWebAPITest.cs @@ -11,7 +11,7 @@ using System.Linq; namespace SpotifyAPI.Tests { [TestFixture] - public class TestClass + public class SpotifyWebAPITest { private static readonly string FixtureDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../fixtures/"); diff --git a/SpotifyAPI.Tests/UtilTest.cs b/SpotifyAPI.Tests/UtilTest.cs new file mode 100644 index 00000000..c78c14ae --- /dev/null +++ b/SpotifyAPI.Tests/UtilTest.cs @@ -0,0 +1,19 @@ +using System; +using NUnit.Framework; +using SpotifyAPI.Web; + +namespace SpotifyAPI.Tests +{ + [TestFixture] + public class UtilTest + { + [Test] + public void TimestampShouldBeNoFloatingPoint() + { + string timestamp = DateTime.Now.ToUnixTimeMillisecondsPoly().ToString(); + + StringAssert.DoesNotContain(".", timestamp); + StringAssert.DoesNotContain(",", timestamp); + } + } +} \ No newline at end of file