mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-16 23:13:07 +01:00
Fix build, upgrade SQLite integration tests to NUnit
This commit is contained in:
parent
f299b1f8e9
commit
e30bc37f41
@ -45,6 +45,7 @@
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
namespace IF.Lastfm.Core.Tests.Api.Commands
|
||||
{
|
||||
|
||||
public class ArtistGetInfoCommandTests : CommandTestsBase
|
||||
{
|
||||
private GetInfoCommand _command;
|
||||
|
@ -1,12 +1,9 @@
|
||||
using IF.Lastfm.Core.Scrobblers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Net.Http;
|
||||
using IF.Lastfm.Core.Helpers;
|
||||
using Scrobbler = IF.Lastfm.Core.Scrobblers.Scrobbler;
|
||||
|
||||
namespace IF.Lastfm.Core.Tests.Scrobblers
|
||||
{
|
||||
[TestClass]
|
||||
public class ScrobblerTests : ScrobblerTestsBase
|
||||
{
|
||||
protected override IScrobbler GetScrobbler()
|
||||
|
@ -7,12 +7,11 @@
|
||||
using IF.Lastfm.Core.Helpers;
|
||||
using IF.Lastfm.Core.Scrobblers;
|
||||
using IF.Lastfm.Core.Tests.Resources;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace IF.Lastfm.Core.Tests.Scrobblers
|
||||
{
|
||||
[TestClass]
|
||||
public abstract class ScrobblerTestsBase
|
||||
{
|
||||
protected IScrobbler Scrobbler { get; private set; }
|
||||
@ -21,7 +20,7 @@ public abstract class ScrobblerTestsBase
|
||||
|
||||
protected QueueFakeResponseHandler FakeResponseHandler { get; private set; }
|
||||
|
||||
[TestInitialize]
|
||||
[SetUp]
|
||||
public void Initialise()
|
||||
{
|
||||
MockAuth = new Mock<ILastAuth>();
|
||||
@ -45,7 +44,7 @@ protected async Task<ScrobbleResponse> ExecuteTestInternal(HttpResponseMessage r
|
||||
protected abstract IScrobbler GetScrobbler();
|
||||
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public async Task CorrectResponseWithBadAuth()
|
||||
{
|
||||
MockAuth.SetupGet(m => m.Authenticated).Returns(false);
|
||||
@ -56,7 +55,7 @@ public async Task CorrectResponseWithBadAuth()
|
||||
Assert.AreEqual(LastResponseStatus.BadAuth, scrobbleResponse.Status);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public async Task CorrectResponseWhenRequestSuccessful()
|
||||
{
|
||||
MockAuth.SetupGet(m => m.Authenticated).Returns(true);
|
||||
@ -67,7 +66,7 @@ public async Task CorrectResponseWhenRequestSuccessful()
|
||||
Assert.AreEqual(LastResponseStatus.Successful, scrobbleResponse.Status);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public async Task CorrectResponseWhenRequestFailed()
|
||||
{
|
||||
MockAuth.SetupGet(m => m.Authenticated).Returns(true);
|
||||
|
@ -4,7 +4,6 @@
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using IF.Lastfm.Core.Api.Helpers;
|
||||
using NUnit.Framework;
|
||||
|
@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace IF.Lastfm.Core.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class TestHelperTests
|
||||
{
|
||||
[TestMethod]
|
||||
[Test]
|
||||
public void RoundsToNearestSecond()
|
||||
{
|
||||
var now = new DateTimeOffset(2015, 03, 04, 20, 07, 21, TimeSpan.Zero);
|
||||
|
@ -44,6 +44,9 @@
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLite-net">
|
||||
<HintPath>..\..\packages\sqlite-net-pcl.1.0.11\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLite-net.dll</HintPath>
|
||||
</Reference>
|
||||
@ -68,11 +71,7 @@
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
<Otherwise />
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="SQLiteScrobblerTests.cs" />
|
||||
|
@ -1,22 +1,8 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using IF.Lastfm.Core.Api;
|
||||
using IF.Lastfm.Core.Api.Enums;
|
||||
using IF.Lastfm.Core.Api.Helpers;
|
||||
using IF.Lastfm.Core.Helpers;
|
||||
using IF.Lastfm.Core.Scrobblers;
|
||||
using IF.Lastfm.Core.Tests;
|
||||
using IF.Lastfm.Core.Tests.Resources;
|
||||
using IF.Lastfm.Core.Scrobblers;
|
||||
using IF.Lastfm.Core.Tests.Scrobblers;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
using SQLite;
|
||||
|
||||
namespace IF.Lastfm.SQLite.Tests.Integration
|
||||
{
|
||||
[TestClass]
|
||||
public class SQLiteeScrobblerTests : ScrobblerTestsBase
|
||||
{
|
||||
protected override IScrobbler GetScrobbler()
|
||||
|
@ -5,6 +5,7 @@
|
||||
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
|
||||
<package id="Moq" version="4.2.1502.0911" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
|
||||
<package id="NUnit" version="2.6.4" targetFramework="net45" />
|
||||
<package id="sqlite-net-pcl" version="1.0.11" targetFramework="net45" />
|
||||
<package id="SQLitePCL.raw_basic" version="0.7.1" targetFramework="net45" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user