Skip to content

Commit a24b667

Browse files
committed
Added Tests for Util class and some cleanup
1 parent cdceb6a commit a24b667

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

SpotifyAPI.Tests/SpotifyAPI.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
<ItemGroup>
5757
<Compile Include="ProxyConfigTest.cs" />
5858
<Compile Include="SpotifyUriTest.cs" />
59-
<Compile Include="TestClass.cs" />
59+
<Compile Include="SpotifyWebAPITest.cs" />
6060
<Compile Include="Properties\AssemblyInfo.cs" />
61+
<Compile Include="UtilTest.cs" />
6162
</ItemGroup>
6263
<ItemGroup>
6364
<ProjectReference Include="..\SpotifyAPI\SpotifyAPI.csproj">

SpotifyAPI.Tests/SpotifyUriTest.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
using Moq;
2-
using Newtonsoft.Json;
3-
using NUnit.Framework;
4-
using SpotifyAPI.Local;
1+
using NUnit.Framework;
52
using SpotifyAPI.Local.Models;
63
using SpotifyAPI.Local.Enums;
74
using System;
8-
using System.Collections.Generic;
9-
using System.IO;
10-
using System.Linq;
115

126
namespace SpotifyAPI.Tests
137
{
8+
[TestFixture]
149
public class SpotifyUriTest
1510
{
1611
[Test]

SpotifyAPI.Tests/TestClass.cs renamed to SpotifyAPI.Tests/SpotifyWebAPITest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace SpotifyAPI.Tests
1212
{
1313
[TestFixture]
14-
public class TestClass
14+
public class SpotifyWebAPITest
1515
{
1616
private static readonly string FixtureDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../fixtures/");
1717

SpotifyAPI.Tests/UtilTest.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using NUnit.Framework;
3+
using SpotifyAPI.Web;
4+
5+
namespace SpotifyAPI.Tests
6+
{
7+
[TestFixture]
8+
public class UtilTest
9+
{
10+
[Test]
11+
public void TimestampShouldBeNoFloatingPoint()
12+
{
13+
string timestamp = DateTime.Now.ToUnixTimeMillisecondsPoly().ToString();
14+
15+
StringAssert.DoesNotContain(".", timestamp);
16+
StringAssert.DoesNotContain(",", timestamp);
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)