Tests: add NUnit support

What's an open source project that cannot be
tested in an open source platform? The best
open source .NET IDE that works in Linux
(MonoDevelop) doesn't have support for
VisualStudio Testing framework, but it has
support for NUnit.

By abstracting a bit the TLSharp.Tests assembly
we can have two different wrappers, one for
NUnit tests and other for VisualStudio tests,
so no one can be left behind.
This commit is contained in:
Andres G. Aragoneses 2016-11-04 00:10:14 +08:00
parent ca78532b34
commit d6887a70f1
9 changed files with 384 additions and 63 deletions

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E90B705B-19FA-43BA-B952-69957976D12C}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>TLSharp.Tests.NUnit</RootNamespace>
<AssemblyName>TLSharp.Tests.NUnit</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Test.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\TLSharp.Tests\app.config">
<Link>app.config</Link>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TLSharp.Tests\TLSharp.Tests.csproj">
<Project>{DE5C0467-EE99-4734-95F2-EFF7A0B99924}</Project>
<Name>TLSharp.Tests</Name>
</ProjectReference>
</ItemGroup>
</Project>

View file

@ -0,0 +1,72 @@

using System;
using System.Threading.Tasks;
using NUnit.Framework;
namespace TLSharp.Tests
{
[TestFixture]
public class TLSharpTestsNUnit : TLSharpTests
{
[TestFixtureSetUp]
public void Init()
{
base.Init(o => Assert.IsNotNull(o), b => Assert.IsTrue(b));
}
[Test]
public async override Task AuthUser()
{
await base.AuthUser();
}
[Test]
public override async Task SendMessageTest()
{
await base.SendMessageTest();
}
[Test]
public override async Task SendMessageToChannelTest()
{
await base.SendMessageToChannelTest();
}
[Test]
public override async Task SendPhotoToContactTest()
{
await base.SendPhotoToContactTest();
}
[Test]
public override async Task SendBigFileToContactTest()
{
await base.SendBigFileToContactTest();
}
[Test]
public override async Task DownloadFileFromContactTest()
{
await base.DownloadFileFromContactTest();
}
[Test]
public override async Task DownloadFileFromWrongLocationTest()
{
await base.DownloadFileFromWrongLocationTest();
}
[Test]
public override async Task SignUpNewUser()
{
await base.SignUpNewUser();
}
[Test]
public override async Task CheckPhones()
{
await base.CheckPhones();
}
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
</packages>