generated from dailydevops/dotnet-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Switched to TUnit
#126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9430e86
feat: Switch to `TUnit` prepared
samtrion cc65de0
chore(sdk): Removed support for `.NET 6` and `.NET 7`
samtrion 862fc67
chore: Extended tests and constraints
samtrion be5fd9c
fix(style): Reformatted code
samtrion ff421c5
fix: Added Pragma TUnit0046
samtrion 958a573
chore: Removed Architecture tests
samtrion 9ab1041
chore: Removed pragma, we are waiting for a new TUnit version
samtrion 6a12cf7
fix(deps): Updated testframeworks
samtrion 2d3ca3f
fix: Added `#pragma warning disable TUnit0046 // TUnit0046: Return a …
samtrion b612f25
fix(deps): Added missing `Microsoft.Testing.Extensions.CodeCoverage`
samtrion 9f24d51
chore: Removed xunit
samtrion b13612d
chore: removed xunit from `Directory.Packages.props`
samtrion 8e8a6e9
chore: Switched to old codecov action
samtrion 513e81c
revert(ci): Reverted pipeline back to versioned
samtrion ec22862
fix: Removed coverlet.msbuild
samtrion bb6b665
fix: Try fix for repaired coverage reports
samtrion bd14dad
revert: Switched back to versioned pipeline
samtrion 3c3ef3d
fix: Try revert/codecov-to-v3
samtrion db4b08b
fix: Extended tests
samtrion 86efb1a
fix: Possbile null reference
samtrion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
16 changes: 16 additions & 0 deletions
16
src/NetEvolve.FluentValue/Constraints/NotDefaultConstraint.cs
This file contains hidden or 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,16 @@ | ||
| namespace NetEvolve.FluentValue.Constraints; | ||
|
|
||
| using System.Text; | ||
| using NetEvolve.FluentValue; | ||
|
|
||
| internal sealed class NotDefaultConstraint : ConstraintBase | ||
| { | ||
| public override bool IsSatisfiedBy(object? value) => | ||
| value?.GetType() switch | ||
| { | ||
| { IsValueType: true } valueType => !TypeExtensions.GetDefault(valueType)?.Equals(value) ?? false, | ||
| _ => true, | ||
| }; | ||
|
|
||
| public override void SetDescription(StringBuilder builder) => builder.Append(" is not <default>"); | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/NetEvolve.FluentValue/Constraints/NotEmptyConstraint.cs
This file contains hidden or 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,20 @@ | ||
| namespace NetEvolve.FluentValue.Constraints; | ||
|
|
||
| using System; | ||
| using System.Collections; | ||
| using System.Text; | ||
|
|
||
| internal sealed class NotEmptyConstraint : ConstraintBase | ||
| { | ||
| public override bool IsSatisfiedBy(object? value) => | ||
| value switch | ||
| { | ||
| string stringValue => stringValue.Length > 0, | ||
| Guid guidValue => guidValue != Guid.Empty, | ||
| ICollection collection => collection.Count > 0, | ||
| IEnumerable enumerable => enumerable.GetEnumerator().MoveNext(), | ||
| _ => false, | ||
| }; | ||
|
|
||
| public override void SetDescription(StringBuilder builder) => builder.Append(" is not <empty>"); | ||
| } | ||
10 changes: 10 additions & 0 deletions
10
src/NetEvolve.FluentValue/Constraints/NotNullConstraint.cs
This file contains hidden or 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,10 @@ | ||
| namespace NetEvolve.FluentValue.Constraints; | ||
|
|
||
| using System.Text; | ||
|
|
||
| internal sealed class NotNullConstraint : ConstraintBase | ||
| { | ||
| public override bool IsSatisfiedBy(object? value) => value is not null; | ||
|
|
||
| public override void SetDescription(StringBuilder builder) => builder.Append(" is not <null>"); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,21 @@ | ||
| namespace NetEvolve.FluentValue; | ||
|
|
||
| using System; | ||
|
|
||
| internal static class TypeExtensions | ||
| { | ||
| internal static object? GetDefault(this Type value) | ||
| { | ||
| if (!value.IsValueType) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| var underlying = Nullable.GetUnderlyingType(value); | ||
| if (underlying is not null) | ||
| { | ||
| return null; | ||
| } | ||
| return Activator.CreateInstance(value)!; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.