Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7
8
9.0.201
10.0.100
10.0.302

- name: Install .NET tools
run: dotnet tool restore
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7
8
9.0.201
10.0.100
10.0.302

- name: Install .NET tools
run: dotnet tool restore
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7
8
9.0.201
10.0.100
10.0.302

- name: Override CSharpFunctionalExtensions Version
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.5" />
<PackageReference Include="CSharpFunctionalExtensions" Version="3.6.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
<PackageReference Include="Scalar.AspNetCore" Version="2.10.3" />
<PackageReference Include="CSharpFunctionalExtensions" Version="3.7.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.10" />
<PackageReference Include="Microsoft.OpenApi" Version="2.11.0" />
<PackageReference Include="Scalar.AspNetCore" Version="2.16.13" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PackageReference Include="AwesomeAssertions" Version="9.4.0" />
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using FluentAssertions;
using AwesomeAssertions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;

Expand All @@ -21,7 +21,10 @@ namespace MyApp.Infrastructure.Errors;
public sealed record NotFoundError(string Message);
""";

var externalAssemblySyntaxTree = CSharpSyntaxTree.ParseText(externalErrorTypeCode);
var externalAssemblySyntaxTree = CSharpSyntaxTree.ParseText(
externalErrorTypeCode,
cancellationToken: TestContext.Current.CancellationToken
);
var externalCompilation = CSharpCompilation.Create(
"ExternalAssembly",
[externalAssemblySyntaxTree],
Expand All @@ -31,7 +34,7 @@ public sealed record NotFoundError(string Message);

// Emit the external assembly to get a reference
using var ms = new MemoryStream();
var emitResult = externalCompilation.Emit(ms);
var emitResult = externalCompilation.Emit(ms, cancellationToken: TestContext.Current.CancellationToken);
emitResult.Success.Should().BeTrue("External assembly should compile");

ms.Position = 0;
Expand Down Expand Up @@ -74,7 +77,10 @@ public sealed record NotFoundError(string Message);
public sealed record ValidationError(string Message);
""";

var externalAssemblySyntaxTree = CSharpSyntaxTree.ParseText(externalErrorTypesCode);
var externalAssemblySyntaxTree = CSharpSyntaxTree.ParseText(
externalErrorTypesCode,
cancellationToken: TestContext.Current.CancellationToken
);
var externalCompilation = CSharpCompilation.Create(
"ExternalAssembly",
[externalAssemblySyntaxTree],
Expand All @@ -83,7 +89,7 @@ public sealed record ValidationError(string Message);
);

using var ms = new MemoryStream();
var emitResult = externalCompilation.Emit(ms);
var emitResult = externalCompilation.Emit(ms, cancellationToken: TestContext.Current.CancellationToken);
emitResult.Success.Should().BeTrue();

ms.Position = 0;
Expand Down Expand Up @@ -138,7 +144,10 @@ namespace MyApp.Infrastructure.Errors;
public sealed record NotFoundError(string Message);
""";

var externalAssemblySyntaxTree = CSharpSyntaxTree.ParseText(externalErrorTypeCode);
var externalAssemblySyntaxTree = CSharpSyntaxTree.ParseText(
externalErrorTypeCode,
cancellationToken: TestContext.Current.CancellationToken
);
var externalCompilation = CSharpCompilation.Create(
"ExternalAssembly",
[externalAssemblySyntaxTree],
Expand All @@ -147,7 +156,7 @@ public sealed record NotFoundError(string Message);
);

using var ms = new MemoryStream();
var emitResult = externalCompilation.Emit(ms);
var emitResult = externalCompilation.Emit(ms, cancellationToken: TestContext.Current.CancellationToken);
emitResult.Success.Should().BeTrue();

ms.Position = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using FluentAssertions;
using AwesomeAssertions;
using Microsoft.CodeAnalysis;

namespace CSharpFunctionalExtensions.HttpResults.Generators.Tests.Rules;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using FluentAssertions;
using AwesomeAssertions;
using Microsoft.CodeAnalysis;

namespace CSharpFunctionalExtensions.HttpResults.Generators.Tests.Rules;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="AwesomeAssertions" Version="9.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PackageReference Include="coverlet.collector" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.v3" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net.Mime;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Net.Http.Headers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net.Mime;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Net.Http.Headers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net.Mime;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Net.Http.Headers;

Expand Down Expand Up @@ -58,7 +58,7 @@ await Task.FromResult(Result.Success(sourceStream))

await using var resultStream = new MemoryStream();
result!.FileStream.Position = 0;
await result!.FileStream.CopyToAsync(resultStream);
await result!.FileStream.CopyToAsync(resultStream, TestContext.Current.CancellationToken);
resultStream.ToArray().Should().BeEquivalentTo(value);
result!.LastModified.Should().Be(lastModified);
result!.FileDownloadName.Should().Be(fileDownloadName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Net.Mime;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Net.Http.Headers;

Expand Down Expand Up @@ -58,7 +58,7 @@ await Task.FromResult(Result.Success<Stream, DocumentMissingError>(sourceStream)

await using var resultStream = new MemoryStream();
result!.FileStream.Position = 0;
await result!.FileStream.CopyToAsync(resultStream);
await result!.FileStream.CopyToAsync(resultStream, TestContext.Current.CancellationToken);
resultStream.ToArray().Should().BeEquivalentTo(value);
result!.LastModified.Should().Be(lastModified);
result!.FileDownloadName.Should().Be(fileDownloadName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using FluentAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using FluentAssertions;
using AwesomeAssertions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Net.Mime;
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Utils;
using FluentAssertions;
using AwesomeAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using CSharpFunctionalExtensions.HttpResults.ResultExtensions;
using CSharpFunctionalExtensions.HttpResults.Tests.Shared;
using CSharpFunctionalExtensions.HttpResults.Tests.Utils;
using FluentAssertions;
using AwesomeAssertions;
using Microsoft.AspNetCore.Http.HttpResults;

namespace CSharpFunctionalExtensions.HttpResults.Tests.ResultExtensions;
Expand Down
Loading
Loading