Add unit tests

This commit is contained in:
Frank A. Krueger 2017-06-13 20:42:06 -07:00
parent 28ebdf2635
commit ab5a1b7829
3 changed files with 52 additions and 0 deletions

View File

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ooui", "Ooui\Ooui.csproj",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples", "Samples\Samples.csproj", "{CDF8BB01-40BB-402F-8446-47AA6F1628F3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples", "Samples\Samples.csproj", "{CDF8BB01-40BB-402F-8446-47AA6F1628F3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -44,5 +46,17 @@ Global
{CDF8BB01-40BB-402F-8446-47AA6F1628F3}.Release|x64.Build.0 = Release|x64 {CDF8BB01-40BB-402F-8446-47AA6F1628F3}.Release|x64.Build.0 = Release|x64
{CDF8BB01-40BB-402F-8446-47AA6F1628F3}.Release|x86.ActiveCfg = Release|x86 {CDF8BB01-40BB-402F-8446-47AA6F1628F3}.Release|x86.ActiveCfg = Release|x86
{CDF8BB01-40BB-402F-8446-47AA6F1628F3}.Release|x86.Build.0 = Release|x86 {CDF8BB01-40BB-402F-8446-47AA6F1628F3}.Release|x86.Build.0 = Release|x86
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Debug|x64.ActiveCfg = Debug|x64
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Debug|x64.Build.0 = Debug|x64
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Debug|x86.ActiveCfg = Debug|x86
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Debug|x86.Build.0 = Debug|x86
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Release|Any CPU.Build.0 = Release|Any CPU
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Release|x64.ActiveCfg = Release|x64
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Release|x64.Build.0 = Release|x64
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Release|x86.ActiveCfg = Release|x86
{78F6E9E7-4322-4F87-8CE9-1EEF1B16D268}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

18
Tests/ButtonTests.cs Normal file
View File

@ -0,0 +1,18 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Ooui;
namespace Tests
{
[TestClass]
public class ButtonTests
{
[TestMethod]
public void DefaultCtor ()
{
var b = new Button ();
Assert.AreEqual ("", b.TextContent);
}
}
}

20
Tests/Tests.csproj Normal file
View File

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170427-09" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.17" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.17" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ooui\Ooui.csproj" />
</ItemGroup>
</Project>