Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/FluentResults/FluentResults.csproj
  • Loading branch information
altmann committed Jun 28, 2024
2 parents 09aec15 + 695cf78 commit b3e1210
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<img src="https://github.com/altmann/FluentResults/blob/master/resources/icons/FluentResults-Icon-64.png" alt="FluentResults"/>

<img src="https://raw.githubusercontent.com/altmann/FluentResults/master/resources/icons/FluentResults-Icon-64.png" alt="FluentResults"/>
# FluentResults

[![Nuget downloads](https://img.shields.io/nuget/v/fluentresults.svg)](https://www.nuget.org/packages/FluentResults/)
Expand Down Expand Up @@ -186,7 +185,7 @@ bool IsDivisibleByTen(int i) => i % 10 == 0;

### Try

In some scenarios you want to execute an action. If this action throws an exception then the exception should be catched and transformed to a result object.
In some scenarios you want to execute an action. If this action throws an exception then the exception should be caught and transformed to a result object.

```csharp
var result = Result.Try(() => DoSomethingCritical());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public AndWhichConstraint<ReasonAssertions, IReason> HaveMetadata(string metadat
.ForCondition(metadata =>
{
metadata.TryGetValue(metadataKey, out var actualMetadataValue);
return actualMetadataValue == metadataValue;
return Equals(actualMetadataValue, metadataValue);
})
.FailWith($"Reason should contain '{metadataKey}' with '{metadataValue}', but not contain it");

Expand Down
7 changes: 6 additions & 1 deletion src/FluentResults/FluentResults.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<PackageProjectUrl>https://github.com/altmann/FluentResults</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/altmann/FluentResults/master/resources/icons/FluentResults-Icon-128.png</PackageIconUrl>
<PackageIcon>FluentResults-Icon-128.png</PackageIcon>

<PackageReadmeFile>README.md</PackageReadmeFile>

<!--SourceLink-->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -29,6 +30,10 @@
<None Include="..\..\resources\icons\FluentResults-Icon-128.png" Pack="true" PackagePath="" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
Expand Down
6 changes: 3 additions & 3 deletions src/FluentResults/Reasons/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected Error()
/// <summary>
/// Creates a new instance of <see cref="Error"/>
/// </summary>
/// <param name="message">Discription of the error</param>
/// <param name="message">Description of the error</param>
public Error(string message)
: this()
{
Expand All @@ -44,7 +44,7 @@ public Error(string message)
/// <summary>
/// Creates a new instance of <see cref="Error"/>
/// </summary>
/// <param name="message">Discription of the error</param>
/// <param name="message">Description of the error</param>
/// <param name="causedBy">The root cause of the <see cref="Error"/></param>
public Error(string message, IError causedBy)
: this(message)
Expand Down Expand Up @@ -169,4 +169,4 @@ public static string ReasonsToString(IReadOnlyCollection<IReason> errorReasons)
return string.Join("; ", errorReasons);
}
}
}
}

0 comments on commit b3e1210

Please sign in to comment.