Added Tests for Util class and some cleanup

This commit is contained in:
Jonas Dellinger 2018-04-01 18:58:26 +02:00
parent cdceb6a57a
commit a24b667eb9
4 changed files with 24 additions and 9 deletions

View File

@ -56,8 +56,9 @@
<ItemGroup> <ItemGroup>
<Compile Include="ProxyConfigTest.cs" /> <Compile Include="ProxyConfigTest.cs" />
<Compile Include="SpotifyUriTest.cs" /> <Compile Include="SpotifyUriTest.cs" />
<Compile Include="TestClass.cs" /> <Compile Include="SpotifyWebAPITest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UtilTest.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SpotifyAPI\SpotifyAPI.csproj"> <ProjectReference Include="..\SpotifyAPI\SpotifyAPI.csproj">

View File

@ -1,16 +1,11 @@
using Moq; using NUnit.Framework;
using Newtonsoft.Json;
using NUnit.Framework;
using SpotifyAPI.Local;
using SpotifyAPI.Local.Models; using SpotifyAPI.Local.Models;
using SpotifyAPI.Local.Enums; using SpotifyAPI.Local.Enums;
using System; using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace SpotifyAPI.Tests namespace SpotifyAPI.Tests
{ {
[TestFixture]
public class SpotifyUriTest public class SpotifyUriTest
{ {
[Test] [Test]

View File

@ -11,7 +11,7 @@ using System.Linq;
namespace SpotifyAPI.Tests namespace SpotifyAPI.Tests
{ {
[TestFixture] [TestFixture]
public class TestClass public class SpotifyWebAPITest
{ {
private static readonly string FixtureDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../fixtures/"); private static readonly string FixtureDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../fixtures/");

View File

@ -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);
}
}
}