Skip to content

Commit

Permalink
Test project
Browse files Browse the repository at this point in the history
  • Loading branch information
13xforever committed Nov 5, 2018
1 parent f56bb99 commit c3dbf8b
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,4 @@ launchSettings.json
*.db
*.db-journal
logs/
*.ird
1 change: 1 addition & 0 deletions Tests/Test Files/Put IRD files here.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

25 changes: 25 additions & 0 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\IrdLibraryClient\IrdLibraryClient.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Test Files\*.ird">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.IO;
using IrdLibraryClient.IrdFormat;
using NUnit.Framework;

namespace Tests
{
[TestFixture]
public class IrdTests
{
[Test]
public void ParsingTest()
{
var baseDir = TestContext.CurrentContext.TestDirectory;
var testFiles = Directory.GetFiles(baseDir, "*.ird", SearchOption.AllDirectories);
Assert.That(testFiles.Length, Is.GreaterThan(0));

foreach (var file in testFiles)
{
var bytes = File.ReadAllBytes(file);
Assert.That(() => IrdParser.Parse(bytes), Throws.Nothing);
}
}
}
}
7 changes: 6 additions & 1 deletion discord-bot-net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PsnClient", "PsnClient\PsnC
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HomoglyphConverter", "HomoglyphConverter\HomoglyphConverter.csproj", "{A1E6566C-F506-43C8-B06E-9A472AEBF447}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IrdLibraryClient", "IrdLibraryClient\IrdLibraryClient.csproj", "{AA2A333B-CD30-41A5-A680-CC9BCB2D726B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IrdLibraryClient", "IrdLibraryClient\IrdLibraryClient.csproj", "{AA2A333B-CD30-41A5-A680-CC9BCB2D726B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{815D60C3-F84B-4AE2-B4E4-48004515FCFD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -39,6 +41,9 @@ Global
{AA2A333B-CD30-41A5-A680-CC9BCB2D726B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA2A333B-CD30-41A5-A680-CC9BCB2D726B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA2A333B-CD30-41A5-A680-CC9BCB2D726B}.Release|Any CPU.Build.0 = Release|Any CPU
{815D60C3-F84B-4AE2-B4E4-48004515FCFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{815D60C3-F84B-4AE2-B4E4-48004515FCFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{815D60C3-F84B-4AE2-B4E4-48004515FCFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit c3dbf8b

Please sign in to comment.