Skip to content

Commit

Permalink
Add xUnit test runner and a simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
nakedmcse committed Mar 24, 2024
1 parent 457cde6 commit 7d363bc
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
37 changes: 37 additions & 0 deletions tests/tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\waifuVault-csharp-api.csproj" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions tests/waifuvaultTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace tests;

public class waifuvaultTests
{
[Fact]
public void SimpleTest()
{
var uploadfile = new Waifuvault.FileUpload("filetarget.png");
Assert.Equal("filetarget.png",uploadfile.filename);
}
}
8 changes: 7 additions & 1 deletion waifuVault-csharp-api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
<RootNamespace>Waifuvault</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xunit" Version="2.7.0" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions waifuVault-csharp-api.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "waifuVault-csharp-api", "waifuVault-csharp-api.csproj", "{C8620F87-3750-4D35-92D9-521E39F5007B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{14505BE4-431B-4FDF-8500-D890997A2C64}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{C8620F87-3750-4D35-92D9-521E39F5007B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8620F87-3750-4D35-92D9-521E39F5007B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8620F87-3750-4D35-92D9-521E39F5007B}.Release|Any CPU.Build.0 = Release|Any CPU
{14505BE4-431B-4FDF-8500-D890997A2C64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14505BE4-431B-4FDF-8500-D890997A2C64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14505BE4-431B-4FDF-8500-D890997A2C64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14505BE4-431B-4FDF-8500-D890997A2C64}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 7d363bc

Please sign in to comment.