-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update to dotnet7, turn off bottomify
- Loading branch information
Showing
8 changed files
with
119 additions
and
27 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/Thankifi.Common.Filters.Abstractions/Thankifi.Common.Filters.Abstractions.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<Title>Thankifi.Common.Filters.Abstractions</Title> | ||
<Description>Abstractions for common filters to have fun with strings.</Description> | ||
<Authors>Lucas Maximiliano Marino</Authors> | ||
<PackageProjectUrl>https://github.com/thankifi/package.filters</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/thankifi/package.filters</RepositoryUrl> | ||
<Copyright>Copyright © Lucas Maximiliano Marino 2021</Copyright> | ||
<Copyright>Copyright © Lucas Maximiliano Marino 2023</Copyright> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Thankifi.Common.Filters.Abstractions; | ||
|
||
namespace Thankifi.Common.Filters.Testing; | ||
|
||
public class FilterTests | ||
{ | ||
private IFilterService _service = null!; | ||
|
||
[SetUp] | ||
public void Setup() | ||
{ | ||
_service = new FilterService(new IFilter[] | ||
{ | ||
new BinaryFilter(), | ||
// new BottomifyFilter(), | ||
new LeetFilter(), | ||
new MockFilter(), | ||
new ShoutingFilter() | ||
}); | ||
} | ||
|
||
[Test] | ||
public async Task CanDoBinary() | ||
{ | ||
var text = await _service.Apply("binary", "This is a Test"); | ||
|
||
Assert.That(text, Is.EqualTo("10101001101000110100111100111000001101001111001110000011000011000001010100110010111100111110100")); | ||
} | ||
|
||
// [Test] | ||
// public async Task CanDoBottomify() | ||
// { | ||
// var text = await _service.Apply("bottomify", "This is a Test"); | ||
// | ||
// Assert.That(text, Is.EqualTo("")); | ||
// } | ||
|
||
[Test] | ||
public async Task CanDoLeet() | ||
{ | ||
var text = await _service.Apply("leet", "This is a Test"); | ||
|
||
Assert.That(text, Is.EqualTo("7h15 15 4 7357")); | ||
} | ||
|
||
[Test] | ||
public async Task CanDoMock() | ||
{ | ||
var text = await _service.Apply("mock", "This is a Test"); | ||
|
||
Assert.That(text, Is.EqualTo("tHiS iS a TeSt")); | ||
} | ||
|
||
[Test] | ||
public async Task CanDoShouting() | ||
{ | ||
var text = await _service.Apply("shouting", "This is a Test"); | ||
|
||
Assert.That(text, Is.EqualTo("THIS IS A TEST")); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Thankifi.Common.Filters.Testing/Thankifi.Common.Filters.Testing.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||
<PackageReference Include="NUnit" Version="3.13.3" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" /> | ||
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" /> | ||
<PackageReference Include="coverlet.collector" Version="3.1.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Thankifi.Common.Filters.Abstractions\Thankifi.Common.Filters.Abstractions.csproj" /> | ||
<ProjectReference Include="..\Thankifi.Common.Filters\Thankifi.Common.Filters.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
global using NUnit.Framework; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Bottom; | ||
using Thankifi.Common.Filters.Abstractions; | ||
|
||
namespace Thankifi.Common.Filters | ||
{ | ||
/// <summary> | ||
/// Bottomify filter. | ||
/// </summary> | ||
public class BottomifyFilter : IFilter | ||
{ | ||
/// <inheritdoc /> | ||
public string Identifier => "bottomify"; | ||
|
||
/// <inheritdoc /> | ||
public Task<string> Apply(string str, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(Bottomify.EncodeString(str)); | ||
} | ||
} | ||
} | ||
// using System.Threading; | ||
// using System.Threading.Tasks; | ||
// using Bottom; | ||
// using Thankifi.Common.Filters.Abstractions; | ||
// | ||
// namespace Thankifi.Common.Filters | ||
// { | ||
// /// <summary> | ||
// /// Bottomify filter. | ||
// /// </summary> | ||
// public class BottomifyFilter : IFilter | ||
// { | ||
// /// <inheritdoc /> | ||
// public string Identifier => "bottomify"; | ||
// | ||
// /// <inheritdoc /> | ||
// public Task<string> Apply(string str, CancellationToken cancellationToken = default) | ||
// { | ||
// return Task.FromResult(Bottomify.EncodeString(str)); | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters