Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KSemenenko committed May 6, 2024
1 parent 2ffb267 commit b948c90
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Orleans.Sdk" Version="8.0.0" />
<PackageReference Include="Microsoft.Orleans.Runtime" Version="8.0.0" />
<PackageReference Include="Microsoft.Orleans.Serialization.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Orleans.Sdk" Version="8.1.0" />
<PackageReference Include="Microsoft.Orleans.Runtime" Version="8.1.0" />
<PackageReference Include="Microsoft.Orleans.Serialization.Abstractions" Version="8.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Orleans.TestingHost" Version="8.0.0" />
<PackageReference Include="Microsoft.Orleans.TestingHost" Version="8.1.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.1" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.4" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
35 changes: 17 additions & 18 deletions ManagedCode.Communication.Tests/Results/ResultFailTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public class ResultFailTests
[Fact]
public void Fail()
{
var ok = Result.Fail();
ok.IsSuccess.Should().BeFalse();
ok.IsFailed.Should().BeTrue();

Assert.True(ok == false);
Assert.False(ok);
var fail = Result.Fail();
fail.IsSuccess.Should().BeFalse();
fail.IsFailed.Should().BeTrue();
Assert.Throws<Exception>(() => fail.ThrowIfFail());
Assert.True(fail == false);
Assert.False(fail);
}

[Fact]
Expand All @@ -33,12 +33,11 @@ public void FailEnum()
[Fact]
public void FailString()
{
var ok = Result.Fail("Oops");
ok.IsSuccess.Should().BeFalse();
ok.IsFailed.Should().BeTrue();

Assert.True(ok == false);
Assert.False(ok);
var fail = Result.Fail("Oops");
fail.IsSuccess.Should().BeFalse();
fail.IsFailed.Should().BeTrue();
Assert.True(fail == false);
Assert.False(fail);
}

[Fact]
Expand Down Expand Up @@ -111,12 +110,12 @@ public void FailFrom()
[Fact]
public void FailT()
{
var ok = Result<MyResultObj>.Fail();
ok.IsSuccess.Should().BeFalse();
ok.IsFailed.Should().BeTrue();

Assert.True(ok == false);
Assert.False(ok);
var fail = Result<MyResultObj>.Fail();
fail.IsSuccess.Should().BeFalse();
fail.IsFailed.Should().BeTrue();
Assert.Throws<Exception>(() => fail.ThrowIfFail());
Assert.True(fail == false);
Assert.False(fail);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion ManagedCode.Communication/ManagedCode.Communication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="ManagedCode.Communication.Orleans" />
Expand Down

0 comments on commit b948c90

Please sign in to comment.