Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
essentials
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Feb 26, 2024
1 parent f79ef68 commit d53c25f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
6 changes: 6 additions & 0 deletions OneWare.Essentials.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "actions", "actions", "{F97A
.github\workflows\test.yml = .github\workflows\test.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneWare.Essentials.UnitTests", "tests\OneWare.Essentials.UnitTests\OneWare.Essentials.UnitTests.csproj", "{410C0588-65EB-45D9-96EF-54245B0D761A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -39,6 +41,10 @@ Global
{02A8AB8A-C9AB-4272-8FE6-852DAABCE52C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{02A8AB8A-C9AB-4272-8FE6-852DAABCE52C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02A8AB8A-C9AB-4272-8FE6-852DAABCE52C}.Release|Any CPU.Build.0 = Release|Any CPU
{410C0588-65EB-45D9-96EF-54245B0D761A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{410C0588-65EB-45D9-96EF-54245B0D761A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{410C0588-65EB-45D9-96EF-54245B0D761A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{410C0588-65EB-45D9-96EF-54245B0D761A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{594A19A2-C55B-4CB8-8C3D-0A9F2A6B5304} = {293AE003-B26A-4C68-90F1-A3FB68AC6111}
Expand Down
14 changes: 14 additions & 0 deletions build/props/XUnit.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.assert" Version="2.5.3" />
<PackageReference Include="xunit.core" Version="2.5.3" />
<PackageReference Include="xunit.extensibility.core" Version="2.5.3" />
<PackageReference Include="xunit.extensibility.execution" Version="2.5.3" />
<PackageReference Include="xunit.runner.console" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/OneWare.Essentials/OneWare.Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Import Project="..\..\build\props\AvaloniaEdit.props"/>
<Import Project="..\..\build\props\AvaloniaEdit.TextMate.props"/>
<Import Project="..\..\build\props\Dock.Avalonia.props" />
<Import Project="..\..\build\props\Prism.Avalonia.props" />
<Import Project="..\..\build\props\Prism.Avalonia.props"/>
<Import Project="..\..\build\props\Jint.props"/>
<Import Project="..\..\build\props\CommunityToolkit.Mvvm.props"/>
<Import Project="..\..\build\props\Asmichi.ChildProcess.props"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\build\props\XUnit.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<IsPackable>False</IsPackable>
<IsTestProject>True</IsTestProject>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<GenerateRuntimeConfigurationFiles>True</GenerateRuntimeConfigurationFiles>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\OneWare.Essentials\OneWare.Essentials.csproj" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions tests/OneWare.Essentials.UnitTests/ProjectHelperTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using OneWare.Essentials.Helpers;
using Xunit;

namespace OneWare.Essentials.UnitTests;

public class ProjectHelperTests
{
[Fact]
public void MathWildCardTests()
{
var include = new[] {"**"};
var exclude = new[] {".git"};

Assert.False(ProjectHelper.MatchWildCards(".git/FETCH_HEAD", include, exclude));
Assert.True(ProjectHelper.MatchWildCards("test.vhd", include, exclude));
Assert.True(ProjectHelper.MatchWildCards("nice/test.vhd", include, exclude));
}
}

0 comments on commit d53c25f

Please sign in to comment.