scaffold unit test proj
This commit is contained in:
@@ -7,6 +7,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F7E2C1BF-916
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamElements.Net", "src\StreamElements.Net\StreamElements.Net.csproj", "{859D5B9E-479D-4374-A600-6706623FD29B}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamElements.Net", "src\StreamElements.Net\StreamElements.Net.csproj", "{859D5B9E-479D-4374-A600-6706623FD29B}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamElements.Net.UnitTests", "src\StreamElements.Net.UnitTests\StreamElements.Net.UnitTests.csproj", "{353AFA8A-638C-4C58-9AF0-3A446C75B79B}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -32,8 +34,21 @@ Global
|
|||||||
{859D5B9E-479D-4374-A600-6706623FD29B}.Release|x64.Build.0 = Release|x64
|
{859D5B9E-479D-4374-A600-6706623FD29B}.Release|x64.Build.0 = Release|x64
|
||||||
{859D5B9E-479D-4374-A600-6706623FD29B}.Release|x86.ActiveCfg = Release|x86
|
{859D5B9E-479D-4374-A600-6706623FD29B}.Release|x86.ActiveCfg = Release|x86
|
||||||
{859D5B9E-479D-4374-A600-6706623FD29B}.Release|x86.Build.0 = Release|x86
|
{859D5B9E-479D-4374-A600-6706623FD29B}.Release|x86.Build.0 = Release|x86
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Release|x64.Build.0 = Release|x64
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B}.Release|x86.Build.0 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{859D5B9E-479D-4374-A600-6706623FD29B} = {F7E2C1BF-9166-4BE9-BE4B-08BE0CEE439F}
|
{859D5B9E-479D-4374-A600-6706623FD29B} = {F7E2C1BF-9166-4BE9-BE4B-08BE0CEE439F}
|
||||||
|
{353AFA8A-638C-4C58-9AF0-3A446C75B79B} = {F7E2C1BF-9166-4BE9-BE4B-08BE0CEE439F}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
19
src/StreamElements.Net.UnitTests/Class1.cs
Normal file
19
src/StreamElements.Net.UnitTests/Class1.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace StreamElements.Net.UnitTests
|
||||||
|
{
|
||||||
|
public class Main
|
||||||
|
{
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Init()
|
||||||
|
{
|
||||||
|
var client = new StreamElements.Net.RestClient();
|
||||||
|
await Assert.ThrowsAsync<ArgumentNullException>(()=>client.GetLoyalty(null));
|
||||||
|
var loyalty = await client.GetLoyalty("terrible_dev");
|
||||||
|
Assert.True(loyalty.Enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
|
||||||
|
<PackageReference Include="xunit" Version="2.2.0" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
||||||
|
<PackageReference Include="refit" Version="4.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\StreamElements.Net\StreamElements.Net.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -34,7 +34,7 @@ namespace StreamElements.Net
|
|||||||
}
|
}
|
||||||
public Task<Models.Results.LoyaltyResult> GetLoyalty(string channel)
|
public Task<Models.Results.LoyaltyResult> GetLoyalty(string channel)
|
||||||
{
|
{
|
||||||
if(string.IsNullOrWhiteSpace(nameof(channel)))
|
if(string.IsNullOrWhiteSpace(channel))
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(channel));
|
throw new ArgumentNullException(nameof(channel));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="refit" Version="4.0.1" />
|
<PackageReference Include="refit" Version="4.0.0" />
|
||||||
<PackageReference Include="UriBuilder.Fluent" Version="1.4.0" />
|
<PackageReference Include="UriBuilder.Fluent" Version="1.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user