Tweaked Test and some Lib modifications

This commit is contained in:
Johnny @PC 2016-03-05 16:24:54 +01:00
parent 8afd134769
commit 4fe00c0f0e
3 changed files with 15 additions and 13 deletions

View File

@ -32,15 +32,17 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Moq"> <Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.2.1506.2515\lib\net40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="nunit.framework"> <Reference Include="nunit.framework, Version=3.0.5797.27534, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.0.0\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -67,11 +69,11 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -28,7 +28,7 @@ namespace SpotifyAPI.Tests
private static T GetFixture<T>(string file) private static T GetFixture<T>(string file)
{ {
return JsonConvert.DeserializeObject<T>(File.ReadAllText(Path.Combine("../../fixtures/", file))); return JsonConvert.DeserializeObject<T>(File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "../../../fixtures/", file)));
} }
private static bool ContainsValues(string str, params string[] values) private static bool ContainsValues(string str, params string[] values)
@ -37,11 +37,11 @@ namespace SpotifyAPI.Tests
} }
[Test] [Test]
[ExpectedException(typeof(InvalidOperationException))]
public void ShouldGetPrivateProfile_WithoutAuth() public void ShouldGetPrivateProfile_WithoutAuth()
{ {
_spotify.UseAuth = false; _spotify.UseAuth = false;
_spotify.GetPrivateProfile();
Assert.Throws<InvalidOperationException>(() => _spotify.GetPrivateProfile());
} }
[Test] [Test]

View File

@ -2,5 +2,5 @@
<packages> <packages>
<package id="Moq" version="4.2.1510.2205" targetFramework="net45" /> <package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
<package id="NUnit" version="3.0.1" targetFramework="net45" /> <package id="NUnit" version="3.0.0" targetFramework="net45" />
</packages> </packages>