Skip to content

Commit

Permalink
Add unit test project
Browse files Browse the repository at this point in the history
  • Loading branch information
myd7349 committed Jul 21, 2024
1 parent 7c5db6e commit 3d5dd19
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
6 changes: 6 additions & 0 deletions SharpLSL.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLSL", "Source\SharpLSL\SharpLSL.csproj", "{0229C461-321D-4662-BC00-C01C0B75C334}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLSL.Test", "Tests\SharpLSL.Test\SharpLSL.Test.csproj", "{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{0229C461-321D-4662-BC00-C01C0B75C334}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0229C461-321D-4662-BC00-C01C0B75C334}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0229C461-321D-4662-BC00-C01C0B75C334}.Release|Any CPU.Build.0 = Release|Any CPU
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B7B2CE6-36CE-4CD5-BF7B-B9C5AACF47F5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Source/SharpLSL/LslChannelFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SharpLSL
{
public enum LslChannelFormat
public enum LslChannelFormat : int
{
Float = lsl_channel_format_t.cft_float32,
Double = lsl_channel_format_t.cft_double64,
Expand Down
15 changes: 15 additions & 0 deletions Tests/SharpLSL.Test/CommonTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Xunit;

using SharpLSL.Interop;

namespace SharpLSL.Test;

public class CommonTest
{
[Fact]
public void Given_When_Then()
{
Assert.Equal(4, sizeof(LslChannelFormat));
Assert.Equal(114, LSL.LIBLSL_COMPILE_HEADER_VERSION);
}
}
3 changes: 3 additions & 0 deletions Tests/SharpLSL.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System;

[assembly: CLSCompliant(true)]
22 changes: 22 additions & 0 deletions Tests/SharpLSL.Test/SharpLSL.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Source\SharpLSL\SharpLSL.csproj" />
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="coverlet.collector" PrivateAssets="all" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

0 comments on commit 3d5dd19

Please sign in to comment.