@@ -0,0 +1,19 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
<PropertyGroup> | |||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion> | |||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | |||||
</PropertyGroup> | |||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> | |||||
<PropertyGroup Label="Globals"> | |||||
<ProjectGuid>69eecb8d-8705-424f-9202-f7f4051ee403</ProjectGuid> | |||||
<RootNamespace>Discord.Net.Tests</RootNamespace> | |||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> | |||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> | |||||
</PropertyGroup> | |||||
<PropertyGroup> | |||||
<SchemaVersion>2.0</SchemaVersion> | |||||
</PropertyGroup> | |||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> | |||||
</Project> |
@@ -0,0 +1,40 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.IO; | |||||
using System.Threading; | |||||
using System.Threading.Tasks; | |||||
using Discord.Net.Rest; | |||||
namespace Discord.Tests.Framework | |||||
{ | |||||
public class MockRestClient : IRestClient | |||||
{ | |||||
public MockRestClient(string baseUrl) | |||||
{ } | |||||
Task<Stream> IRestClient.SendAsync(string method, string endpoint, bool headerOnly) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
Task<Stream> IRestClient.SendAsync(string method, string endpoint, IReadOnlyDictionary<string, object> multipartParams, bool headerOnly) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
Task<Stream> IRestClient.SendAsync(string method, string endpoint, string json, bool headerOnly) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
void IRestClient.SetCancelToken(CancellationToken cancelToken) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
void IRestClient.SetHeader(string key, string value) | |||||
{ | |||||
throw new NotImplementedException(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,20 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using Xunit; | |||||
using Discord; | |||||
using Discord.Rest; | |||||
namespace Discord.Tests.Rest | |||||
{ | |||||
public class LoginTests : IClassFixture<RestFixture> | |||||
{ | |||||
DiscordRestClient client; | |||||
public LoginTests(RestFixture fixture) | |||||
{ | |||||
client = fixture.Client; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using Discord.Rest; | |||||
using Discord.Net.Rest; | |||||
using Discord.Tests.Framework; | |||||
namespace Discord.Tests.Rest | |||||
{ | |||||
public class RestFixture | |||||
{ | |||||
public DiscordRestClient Client { get; set; } | |||||
public RestFixture() | |||||
{ | |||||
var Config = new DiscordRestConfig() | |||||
{ | |||||
RestClientProvider = new RestClientProvider(baseUrl => new MockRestClient(baseUrl)) | |||||
}; | |||||
Client = new DiscordRestClient(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,14 @@ | |||||
using System; | |||||
using Xunit; | |||||
namespace Tests | |||||
{ | |||||
public class Tests | |||||
{ | |||||
[Fact] | |||||
public void Test1() | |||||
{ | |||||
Assert.True(true); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,27 @@ | |||||
{ | |||||
"version": "1.0.0-*", | |||||
"buildOptions": { | |||||
"debugType": "portable" | |||||
}, | |||||
"dependencies": { | |||||
"System.Runtime.Serialization.Primitives": "4.1.1", | |||||
"xunit": "2.1.0", | |||||
"dotnet-test-xunit": "1.0.0-*", | |||||
"Discord.Net": "1.0.0-*" | |||||
}, | |||||
"testRunner": "xunit", | |||||
"frameworks": { | |||||
"netcoreapp1.0": { | |||||
"dependencies": { | |||||
"Microsoft.NETCore.App": { | |||||
"type": "platform", | |||||
"version": "1.0.0" | |||||
} | |||||
}, | |||||
"imports": [ | |||||
"dotnet5.4", | |||||
"portable-net451+win8" | |||||
] | |||||
} | |||||
} | |||||
} |