Skip to content

Commit

Permalink
- Add debug symbols
Browse files Browse the repository at this point in the history
- Update packages
- Add project files analyzers
  • Loading branch information
Corniel committed May 17, 2024
1 parent be9907d commit 8858492
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 47 deletions.
7 changes: 4 additions & 3 deletions example/ConquerClub.Domain/ConquerClub.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>library</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,9 +17,9 @@

<ItemGroup>
<PackageReference Include="MathNet.Numerics.Signed" Version="5.0.0" />
<PackageReference Include="Qowaiv" Version="6.4.1" />
<PackageReference Include="Qowaiv.Validation.Fluent" Version="0.3.0" />
<PackageReference Include="Qowaiv.Validation.Messages" Version="0.3.0" />
<PackageReference Include="Qowaiv" Version="6.6.2" />
<PackageReference Include="Qowaiv.Validation.Fluent" Version="0.3.1" />
<PackageReference Include="Qowaiv.Validation.Messages" Version="0.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/ConquerClub.Domain/Events/Finished.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace ConquerClub.Domain.Events;

public record Finished();
public sealed record Finished();
19 changes: 12 additions & 7 deletions example/ConquerClub.UnitTests/ConquerClub.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>library</OutputType>
</PropertyGroup>

<ItemGroup>
<ItemGroup Label="TestTools">
<PackageReference Include="coverlet.collector" Version="*" PrivateAssets="all" />
<PackageReference Include="coverlet.msbuild" Version="*" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.*" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="nunit" Version="3.*" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="NUnit" Version="4.*" />
<PackageReference Include="NUnit3TestAdapter" Version="*" PrivateAssets="all" />
<PackageReference Include="Qowaiv.Validation.TestTools" Version="0.3.0" />
</ItemGroup>

<!-- We do not want to report on this during a PR/Release build. -->
<ItemGroup Label="Analyzers" Condition="'$(Configuration)'=='DEBUG'">
<PackageReference Include="FluentAssertions.Analyzers" Version="*" PrivateAssets="all" />
<PackageReference Include="NUnit.Analyzers" Version="*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Qowaiv.DomainModel.TestTools\Qowaiv.DomainModel.TestTools.csproj" />
<ProjectReference Include="..\ConquerClub.Domain\ConquerClub.Domain.csproj" />
Expand Down
16 changes: 8 additions & 8 deletions example/ConquerClub.UnitTests/Dice_specs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Odds
public void For_3_vs_2_are_2890_wins_2611_draws_2275_losses()
{
var outcome = TwoDice(Get2Out3().ToArray(), Get2Out2().ToArray());
Assert.AreEqual(new DiceOutcome(2890, 2611, 2275), outcome);
outcome.Should().Be(new DiceOutcome(2890, 2611, 2275));

GenerateTwo(outcome, "3v2");
}
Expand All @@ -17,7 +17,7 @@ public void For_3_vs_2_are_2890_wins_2611_draws_2275_losses()
public void For_3_vs_1_are_855_wins_441_losses()
{
var outcome = OneDice(Get2Out3().ToArray(), Get1Out1().ToArray());
Assert.AreEqual(new DiceOutcome(855, 0, 441), outcome);
outcome.Should().Be(new DiceOutcome(855, 0, 441));

GenerateOne(outcome, "3v1");
}
Expand All @@ -26,7 +26,7 @@ public void For_3_vs_1_are_855_wins_441_losses()
public void For_2_vs_2_are_295_wins_420_draws_581_losses()
{
var outcome = TwoDice(Get2Out2().ToArray(), Get2Out2().ToArray());
Assert.AreEqual(new DiceOutcome(295, 420, 581), outcome);
outcome.Should().Be(new DiceOutcome(295, 420, 581));

GenerateTwo(outcome, "2v2");
}
Expand All @@ -35,15 +35,15 @@ public void For_2_vs_2_are_295_wins_420_draws_581_losses()
public void For_2_vs_1_are_125_wins_91_losses()
{
var outcome = OneDice(Get2Out2().ToArray(), Get1Out1().ToArray());
Assert.AreEqual(new DiceOutcome(125, 0, 91), outcome);
outcome.Should().Be(new DiceOutcome(125, 0, 91));

GenerateOne(outcome, "2v1");
}
[Test]
public void For_1_vs_2_are_55_wins_161_losses()
{
var outcome = OneDice(Get1Out1().ToArray(), Get2Out2().ToArray());
Assert.AreEqual(new DiceOutcome(55, 0, 161), outcome);
outcome.Should().Be(new DiceOutcome(55, 0, 161));

GenerateOne(outcome, "1v2");
}
Expand All @@ -52,7 +52,7 @@ public void For_1_vs_2_are_55_wins_161_losses()
public void For_1_vs_1_are_15_wins_21_losses()
{
var outcome = OneDice(Get1Out1().ToArray(), Get1Out1().ToArray());
Assert.AreEqual(new DiceOutcome(15, 0, 21), outcome);
outcome.Should().Be(new DiceOutcome(15, 0, 21));

GenerateOne(outcome, "1v1");
}
Expand Down Expand Up @@ -287,7 +287,7 @@ public void Defender_has_armies_on_unsuccessful_attack()

var result = Dice.AutoAttack(attacker, defender, rnd);

Assert.IsFalse(result.IsSuccess);
Assert.AreEqual(new AttackResult(Player.P1.Army(3), Player.P2.Army(3)), result);
result.IsSuccess.Should().BeFalse();
result.Should().Be(new AttackResult(Player.P1.Army(3), Player.P2.Army(3)));
}
}
20 changes: 10 additions & 10 deletions props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
<Company>Qowaiv community</Company>
<Copyright>Copyright © Qowaiv community 2013-current</Copyright>
<LangVersion>12.0</LangVersion>
<IsPublishable>false</IsPublishable>
<Nullable>enable</Nullable>
<!-- We ship package versions for obsolete target frameworks too -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BackwardsCompatibleFeatures" Version="2.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Label="Analyzers">
<PackageReference Include="PolySharp" Version="1.*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Analyzers">
<PackageReference Include="AsyncFixer" Version="*" PrivateAssets="all" />
<PackageReference Include="DotNetProjectFile.Analyzers" Version="*" PrivateAssets="all" Condition="'$(TargetFramework)'=='net8.0'" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="*-*" PrivateAssets="all" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="*" PrivateAssets="all" />
</ItemGroup>

<!-- for code coverage an proper debugging -->
<PropertyGroup>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup Label="Additional files">
<AdditionalFiles Include="*.csproj" Visible="false" />
<AdditionalFiles Include="../../props/common.props" Link="Properties/common.props" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions props/nopackage.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\build\Qowaiv.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup Label="Additional files">
<AdditionalFiles Include="../../props/nopackage.props" Link="Properties/nopackage.props" />
</ItemGroup>

</Project>
24 changes: 22 additions & 2 deletions props/package.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,37 @@

<Import Project="common.props" />

<PropertyGroup Condition="'$(CompileConfig)' != 'DEBUG'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<PackageIcon>package-icon.png</PackageIcon>
<PackageProjectUrl>http://www.github.com/Qowaiv/Qowaiv</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/Qowaiv/Qowaiv</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DefineConstants>CONTRACTS_FULL</DefineConstants>
</PropertyGroup>

<ItemGroup>
<!-- Shared assembly tags. -->
<Compile Include="$(MSBuildThisFileDirectory)..\shared\ProductInfo.cs" Link="Properties\ProductInfo.cs" />
<!-- Package icon. -->
</ItemGroup>

<PropertyGroup Label="Debug Symbols">
<DebugType>portable</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup Label="Package files">
<None Include="$(MSBuildThisFileDirectory)..\design\package-icon.png" Pack="true" PackagePath="" />
<!-- TODO: Include a README per package.
<None Include="README.md" Pack="true" PackagePath="" />
-->
</ItemGroup>

<PropertyGroup Label="Signing">
Expand All @@ -31,4 +47,8 @@
<PackageReference Include="StyleCop.Analyzers" Version="*-*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Label="Additional files">
<AdditionalFiles Include="../../props/package.props" Link="Properties/package.props" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ internal sealed class CollectionDebugView
public CollectionDebugView(IEnumerable enumeration) => this.enumeration = enumeration;

/// <summary>The array that is shown by the debugger.</summary>
/// <remarks>
/// Every time the enumeration is shown in the debugger, a new array is created.
/// By doing this, it is always in sync with the current state of the enumeration.
/// </remarks>
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
#pragma warning disable S2365 // Properties should not make collection or array copies
// Every time the enumeration is shown in the debugger, a new array is created.
// By doing this, it is always in sync with the current state of the enumeration.
public object[] Items => enumeration.Cast<object>().ToArray();
#pragma warning restore S2365 // Properties should not make collection or array copies

/// <summary>A reference to the enumeration to display.</summary>
private readonly IEnumerable enumeration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>library</OutputType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<PackageId>Qowaiv.DomainModel.TestTools</PackageId>
<PackageReleaseNotes>
ToBeRealesed
v1.0.1
- Publish .NET 8.0. #41
v1.0.0
- Assertions helpers are FluentAssertion based. #35 (breaking)
Expand All @@ -18,6 +20,8 @@ v0.1.0
v0.0.1
- Initial release
</PackageReleaseNotes>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -29,11 +33,8 @@ v0.0.1
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.*" PrivateAssets="all" />
</ItemGroup>

</Project>
3 changes: 0 additions & 3 deletions src/Qowaiv.DomainModel/Aggregate_TAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ protected Aggregate(IValidator<TAggregate> validator)
protected IValidator<TAggregate> Validator { get; }

/// <summary>Gets an <see cref="ImmutableCollection.Empty"/> collection.</summary>
#pragma warning disable S2743 // Static fields should not be used in generic types
// FP: nothing is shared, by design.
protected static ImmutableCollection Events => ImmutableCollection.Empty;
#pragma warning restore S2743 // Static fields should not be used in generic types

/// <summary>The dispatcher that calls the methods that (re)play the different events.</summary>
protected virtual EventDispatcher Dispatcher { get; }
Expand Down
4 changes: 4 additions & 0 deletions src/Qowaiv.DomainModel/Qowaiv.DomainModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>library</OutputType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.1.1</Version>
<PackageId>Qowaiv.DomainModel</PackageId>
<PackageReleaseNotes>
v1.1.1
- CommandProcessor made thread-safe. #42
Expand Down Expand Up @@ -52,6 +54,8 @@ v0.0.2
v0.0.1
- Initial release
</PackageReleaseNotes>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>library</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -12,11 +13,11 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.*" />
<PackageReference Include="NUnit" Version="3.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="NUnit" Version="4.*" />
<PackageReference Include="NUnit3TestAdapter" Version="*" PrivateAssets="all" />
<PackageReference Include="Qowaiv.TestTools" Version="6.4.0" />
<PackageReference Include="Qowaiv.Validation.TestTools" Version="0.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
</ItemGroup>

<ItemGroup Label="Analyzers">
Expand Down

0 comments on commit 8858492

Please sign in to comment.