Skip to content

Commit

Permalink
Merge pull request #29 from pfpack/release/v3.0.1-rc.1
Browse files Browse the repository at this point in the history
release/v3.0.1-rc.1
  • Loading branch information
andreise authored Dec 25, 2024
2 parents 17881de + d15f3ca commit b9bc3ae
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
with:
dotnet-version: |
8.0.x
9.0.x
# Create Local NuGet Source

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ StyleCopReport.xml
*.pgc
*.pgd
*.rsp
# but not Directory.Build.rsp, as it configures directory-level build defaults
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
Expand Down
6 changes: 6 additions & 0 deletions directory.build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- IDE0130 // Namespace does not match folder structure -->
<NoWarn>$(NoWarn);IDE0130</NoWarn>
</PropertyGroup>
</Project>
12 changes: 6 additions & 6 deletions src/core-unit/Unit.Tests.Old/Unit.Tests.Old.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -20,14 +20,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.3.1" />
<PackageReference Include="NUnit.Analyzers" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="PrimeFuncPack.UnitTest.Data" Version="3.1.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/core-unit/Unit.Tests/Unit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -24,9 +24,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/core-unit/Unit/Unit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -18,7 +18,7 @@
<Description>PrimeFuncPack Core.Unit is a core library for .NET consisting of Unit type targeted for use in functional programming.</Description>
<RootNamespace>System</RootNamespace>
<AssemblyName>PrimeFuncPack.Core.Unit</AssemblyName>
<Version>3.0.0</Version>
<Version>3.0.1-rc.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
17 changes: 4 additions & 13 deletions src/core-unit/Unit/UnitJsonConverter/UnitJsonConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Text.Json;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace System;
Expand All @@ -8,17 +7,11 @@ internal sealed class UnitJsonConverter : JsonConverter<Unit>
{
public override Unit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var tokenType = reader.TokenType;
Debug.Assert(tokenType is not JsonTokenType.None);

switch (tokenType)
switch (reader.TokenType)
{
case JsonTokenType.StartObject:
case JsonTokenType.StartArray:
reader.Skip();
Debug.Assert(
tokenType is JsonTokenType.StartObject && reader.TokenType is JsonTokenType.EndObject ||
tokenType is JsonTokenType.StartArray && reader.TokenType is JsonTokenType.EndArray);
return default;

case JsonTokenType.String:
Expand All @@ -28,15 +21,13 @@ tokenType is JsonTokenType.StartObject && reader.TokenType is JsonTokenType.EndO
case JsonTokenType.Null:
return default;

default:
throw new JsonException($"An unexpected JSON token type ({tokenType}).");
case var unexpected:
throw new JsonException($"An unexpected JSON token type ({unexpected}).");
};
}

public override void Write(Utf8JsonWriter writer, Unit value, JsonSerializerOptions options)
{
Debug.Assert(writer is not null);

writer.WriteStartObject();
writer.WriteEndObject();
}
Expand Down

0 comments on commit b9bc3ae

Please sign in to comment.