Skip to content

Commit b52db2b

Browse files
authored
Merge pull request #263 from sharparchitecture/releases/8.0.0
Release 8.0.0
2 parents c3718f0 + fd1ad3a commit b52db2b

91 files changed

Lines changed: 2654 additions & 814 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Build.props

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22
<PropertyGroup Label="Build">
33
<Product>Sharp Architecture</Product>
44
<Authors>Sharp Architecture Dev Team</Authors>
5-
6-
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
5+
<Copyright>Copyright &#xA9; Sharp Architecture Development Team</Copyright>
6+
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
7+
<Culture></Culture>
78
<SignAssembly>false</SignAssembly>
8-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
9+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
10+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
11+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
912
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1013
<DebugSymbols>true</DebugSymbols>
1114
<DebugType>portable</DebugType>
1215

13-
<LangVersion>9.0</LangVersion>
16+
<LangVersion>latest</LangVersion>
1417
<Nullable>enable</Nullable>
1518
<IsTestProject>false</IsTestProject>
19+
20+
<NoWarn>$(NoWarn);0105</NoWarn>
1621
</PropertyGroup>
1722

1823
<PropertyGroup Label="Custom targets">
1924
<!-- target frameworks for unit-tests and applications -->
20-
<AppTargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</AppTargetFrameworks>
25+
<AppTargetFrameworks>netcoreapp3.1;net5.0;net6.0</AppTargetFrameworks>
2126
</PropertyGroup>
2227

2328
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
@@ -29,7 +34,7 @@
2934
</PropertyGroup>
3035

3136
<!-- nullable checks -->
32-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net5.0' ">
37+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net6.0'">
3338
<DefineConstants>$(DefineConstants);NULLABLE_REFERENCE_TYPES</DefineConstants>
3439
</PropertyGroup>
3540

@@ -39,7 +44,7 @@
3944
<PackageIconUrl>https://github.com/sharparchitecture/Sharp-Architecture/raw/master/Artefacts/Documentation/icon.png</PackageIconUrl>
4045
<PackageProjectUrl>http://sharparchitecture.github.io/</PackageProjectUrl>
4146
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
42-
<PackageReleaseNotes>https://github.com/sharparchitecture/Sharp-Architecture/releases/tag/7.0.0</PackageReleaseNotes>
47+
<PackageReleaseNotes>https://github.com/sharparchitecture/Sharp-Architecture/releases/tag/8.0.0</PackageReleaseNotes>
4348
<PackageTags>sharp-architecture;sharp-arch</PackageTags>
4449
</PropertyGroup>
4550

@@ -57,9 +62,33 @@
5762
<NoWarn>$(NoWarn);0618;1591</NoWarn>
5863
</PropertyGroup>
5964

60-
<PropertyGroup Condition="'$(MSBuildProjectFullPath.Contains(Sample))' == true ">
65+
<ItemGroup Condition="'$(MSBuildProjectName.Contains(Tests))' == false">
66+
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
67+
<_Parameter1>SharpArch.XunitTests</_Parameter1>
68+
</AssemblyAttribute>
69+
</ItemGroup>
70+
71+
72+
<PropertyGroup Condition="'$(MSBuildProjectFullPath.Contains(Sample))' == true">
6173
<IsPackable>false</IsPackable>
6274
<NoWarn>$(NoWarn);1591</NoWarn>
6375
</PropertyGroup>
6476

77+
78+
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
79+
<LangVersion>preview</LangVersion>
80+
</PropertyGroup>
81+
82+
<ItemGroup>
83+
<AssemblyAttribute Include="System.Runtime.InteropServices.ComVisibleAttribute">
84+
<_Parameter1>false</_Parameter1>
85+
<_Parameter1_TypeName>System.Boolean</_Parameter1_TypeName>
86+
</AssemblyAttribute>
87+
</ItemGroup>
88+
89+
<!-- Common references -->
90+
<ItemGroup>
91+
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0" />
92+
</ItemGroup>
93+
6594
</Project>

Samples/TardisBank/Src/Suteki.TardisBank.Api/Suteki.TardisBank.Api.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
99
</ItemGroup>
1010

11-
<ItemGroup Label="Package References (.NET 5)" Condition=" '$(TargetFramework)' == 'net5' ">
11+
<ItemGroup Label="Package References (.NET 5)" Condition=" '$(TargetFramework)' == 'net5.0' ">
1212
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" PrivateAssets="All" />
1716
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1817
</ItemGroup>
1918

Samples/TardisBank/Src/Suteki.TardisBank.Domain/Suteki.TardisBank.Domain.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" />
98
<PackageReference Include="MediatR" Version="9.0.0" />
109
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1110
</ItemGroup>

Samples/TardisBank/Src/Suteki.TardisBank.Infrastructure/Suteki.TardisBank.Infrastructure.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
<ItemGroup>
88
<PackageReference Include="AutoMapper" Version="10.1.1" />
99
<PackageReference Include="FluentNHibernate" Version="3.1.0" />
10-
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
11-
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" />
12-
<PackageReference Include="NHibernate" Version="5.3.8" />
10+
<PackageReference Include="Humanizer.Core" Version="2.11.10" />
11+
<PackageReference Include="NHibernate" Version="5.3.10" />
1312
</ItemGroup>
1413

1514
<ItemGroup>

Samples/TardisBank/Src/Suteki.TardisBank.Tasks/IUserService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Suteki.TardisBank.Tasks
88
public interface IUserService
99
{
1010
Task<User?> GetCurrentUser(CancellationToken cancellationToken = default);
11-
Task<User> GetUser(int userId, CancellationToken cancellationToken = default);
11+
Task<User?> GetUser(int userId, CancellationToken cancellationToken = default);
1212
Task<User?> GetUserByUserName(string userName, CancellationToken cancellationToken = default);
1313
Task<User?> GetUserByActivationKey(string activationKey, CancellationToken cancellationToken = default);
1414
Task SaveUser(User user, CancellationToken cancellationToken = default);

Samples/TardisBank/Src/Suteki.TardisBank.Tasks/Suteki.TardisBank.Tasks.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" />
98
<PackageReference Include="MediatR" Version="9.0.0" />
10-
<PackageReference Include="NHibernate" Version="5.3.8" />
9+
<PackageReference Include="NHibernate" Version="5.3.10" />
1110
</ItemGroup>
1211

1312
<ItemGroup>

Samples/TardisBank/Src/Suteki.TardisBank.Tasks/UserService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public UserService(IHttpContextService context, ILinqRepository<Parent, int> par
3232
return GetUserByUserName(_context.UserName, cancellationToken);
3333
}
3434

35-
public Task<User> GetUser(int userId, CancellationToken cancellationToken)
35+
public Task<User?> GetUser(int userId, CancellationToken cancellationToken)
3636
{
3737
return _userRepository.FindOneAsync(userId, cancellationToken);
3838
}

Samples/TardisBank/Src/Suteki.TardisBank.Tests/Functional/Setup/TestServerSetup.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ public class TestServerSetup : IDisposable
1515
public TestServerSetup()
1616
{
1717
Server = new TestServer(Program.CreateHostBuilder(Array.Empty<string>())
18-
#if NETCOREAPP3_1 || NET5_0
1918
.UseTestServer()
20-
#endif
2119
.UseStartup<Startup>()
2220
.UseSolutionRelativeContentRoot("TardisBank/Src/Suteki.TardisBank.WebApi/")
2321
);

Samples/TardisBank/Src/Suteki.TardisBank.Tests/Model/ChildTests.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ namespace Suteki.TardisBank.Tests.Model
66
using Domain;
77
using FluentAssertions;
88
using SharpArch.NHibernate;
9-
using SharpArch.NHibernate.Impl;
109
using SharpArch.Testing.Xunit.NHibernate;
1110
using Xunit;
1211

@@ -33,40 +32,39 @@ protected override async Task LoadTestData(CancellationToken cancellationToken)
3332

3433
var child = parent.CreateChild("Leo", "leohadlow", "xxx");
3534
await Session.SaveAsync(child, cancellationToken);
36-
await FlushSessionAndEvict(child, cancellationToken);
37-
await FlushSessionAndEvict(parent, cancellationToken);
35+
await Session.FlushAndEvictAsync(cancellationToken, child, parent);
3836
_childId = child.Id;
3937
}
4038

4139
[Fact]
4240
public async Task Should_be_able_to_add_schedule_to_account()
4341
{
44-
var childToTestOn = await _childRepository.GetAsync(_childId);
42+
var childToTestOn = (await _childRepository.GetAsync(_childId))!;
4543
childToTestOn.Should().NotBeNull();
4644

4745
childToTestOn.Account.AddPaymentSchedule(DateTime.UtcNow, Interval.Week, 10, "Weekly pocket money");
4846
await FlushSessionAndEvict(childToTestOn);
4947

50-
var child = await _childRepository.GetAsync(_childId);
48+
var child = (await _childRepository.GetAsync(_childId))!;
5149
child.Should().NotBeNull();
5250
child.Account.PaymentSchedules[0].Id.Should().BePositive("schedule was not persisted");
5351
}
5452

5553
[Fact]
5654
public async Task Should_be_able_to_add_transaction_to_account()
5755
{
58-
var childToTestOn = await _childRepository.GetAsync(_childId);
56+
var childToTestOn = (await _childRepository.GetAsync(_childId))!;
5957
childToTestOn.ReceivePayment(10, "Reward");
6058
await FlushSessionAndEvict(childToTestOn);
6159

62-
var child = await _childRepository.GetAsync(_childId);
60+
var child = (await _childRepository.GetAsync(_childId))!;
6361
child.Account.Transactions[0].Id.Should().BePositive();
6462
}
6563

6664
[Fact]
6765
public async Task Should_be_able_to_create_and_retrieve_a_child()
6866
{
69-
var child = await _childRepository.GetAsync(_childId);
67+
var child = (await _childRepository.GetAsync(_childId))!;
7068
child.Name.Should().Be("Leo");
7169
child.UserName.Should().Be(@"leohadlow");
7270
child.ParentId.Should().Be(_parentId);

Samples/TardisBank/Src/Suteki.TardisBank.Tests/Model/MessageTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ namespace Suteki.TardisBank.Tests.Model
77
using MediatR;
88
using Moq;
99
using SharpArch.NHibernate;
10-
using SharpArch.NHibernate.Impl;
11-
using SharpArch.Testing.NHibernate;
1210
using SharpArch.Testing.Xunit.NHibernate;
1311
using Xunit;
1412

1513

1614
public class MessageTests : TransientDatabaseTests<TransientDatabaseSetup>
1715
{
1816
int _userId;
19-
Mock<IMediator> _mediator;
17+
readonly Mock<IMediator> _mediator;
2018

2119
public MessageTests(TransientDatabaseSetup dbSetup) : base(dbSetup)
2220
{
@@ -36,13 +34,13 @@ protected override async Task LoadTestData(CancellationToken cancellationToken)
3634
public async Task Should_be_able_to_add_a_message_to_a_user()
3735
{
3836
var parentRepository = new LinqRepository<Parent, int>(TransactionManager);
39-
User userToTestWith = await parentRepository.GetAsync(_userId);
37+
User userToTestWith = (await parentRepository.GetAsync(_userId))!;
4038

4139
userToTestWith.SendMessage("some message", _mediator.Object);
4240

4341
await FlushSessionAndEvict(userToTestWith);
4442

45-
Parent parent = await parentRepository.GetAsync(_userId);
43+
Parent parent = (await parentRepository.GetAsync(_userId))!;
4644
parent.Messages.Count.Should().Be(1);
4745
}
4846
}

0 commit comments

Comments
 (0)