Skip to content

Commit 1cd2587

Browse files
authored
Merge pull request #13 from hash-code-io/feat/net8
Feat/net8
2 parents ac04186 + 2ada567 commit 1cd2587

15 files changed

+107
-75
lines changed

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- These properties will be shared for all projects -->
33

44
<PropertyGroup>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

src/Directory.Build.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ItemGroup>
33
<!--build related-->
44
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="All" />
5-
<PackageReference Include="Microsoft.SourceLink.Github" Version="1.1.1" PrivateAssets="All"/>
5+
<PackageReference Include="Microsoft.SourceLink.Github" Version="8.0.0" PrivateAssets="All"/>
66
</ItemGroup>
77

88
<Target Name="SetAssemblyVersion" AfterTargets="MinVer">

src/RapidIntegrationTesting.Utility/Extensions/IntegrationTestExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static class IntegrationTestExtensions
1616
/// <exception cref="ArgumentNullException"></exception>
1717
public static string GetRelativePathToController(this string controllerName, string apiVersion = "1.0")
1818
{
19-
if (controllerName == null) throw new ArgumentNullException(nameof(controllerName));
19+
ArgumentNullException.ThrowIfNull(controllerName);
2020
return $"api/v{apiVersion}/{controllerName.Replace("Controller", "", StringComparison.OrdinalIgnoreCase)}";
2121
}
2222

@@ -29,7 +29,7 @@ public static string GetRelativePathToController(this string controllerName, str
2929
[SuppressMessage("Design", "CA1054:URI-like parameters should not be strings", Justification = "Pointless if it was URI")]
3030
public static Uri AsRelativeUri(this string url)
3131
{
32-
if (url == null) throw new ArgumentNullException(nameof(url));
32+
ArgumentNullException.ThrowIfNull(url);
3333
return new Uri(url, UriKind.Relative);
3434
}
3535

@@ -43,8 +43,8 @@ public static Uri AsRelativeUri(this string url)
4343
[SuppressMessage("Design", "CA1054:URI-like parameters should not be strings", Justification = "Pointless if it was URI")]
4444
public static Uri AsRelativeUri(this string url, Dictionary<string, string> queryParams)
4545
{
46-
if (url == null) throw new ArgumentNullException(nameof(url));
47-
if (queryParams == null) throw new ArgumentNullException(nameof(queryParams));
46+
ArgumentNullException.ThrowIfNull(url);
47+
ArgumentNullException.ThrowIfNull(queryParams);
4848
string paramString = queryParams.Count == 0
4949
? string.Empty
5050
: "?" + string.Join('&', queryParams.Select(x => $"{x.Key}={x.Value}"));
@@ -63,8 +63,8 @@ public static Uri AsRelativeUri(this string url, Dictionary<string, string> quer
6363
[SuppressMessage("Design", "CA1054:URI-like parameters should not be strings", Justification = "Pointless if it was URI")]
6464
public static Uri AsRelativeUri(this string url, params (string key, string value)[] queryParams)
6565
{
66-
if (url == null) throw new ArgumentNullException(nameof(url));
67-
if (queryParams == null) throw new ArgumentNullException(nameof(queryParams));
66+
ArgumentNullException.ThrowIfNull(url);
67+
ArgumentNullException.ThrowIfNull(queryParams);
6868
string paramString = queryParams.Length == 0
6969
? string.Empty
7070
: "?" + string.Join('&', queryParams.Select(x => $"{x.key}={x.value}"));

src/RapidIntegrationTesting.Utility/RapidIntegrationTesting.Utility.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.14" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
1313
</ItemGroup>
1414

1515

src/RapidIntegrationTesting.Utility/Seeder/TestSeeder.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public TestSeeder<TDbContext> Unseed<TEntity>(IdRetriever idRetriever)
6565
/// <param name="idRetriever">A function to retrieve the entity's id</param>
6666
protected void Create<T>(T entity, EntityIdRetriever<T> idRetriever) where T : class
6767
{
68-
if (idRetriever == null) throw new ArgumentNullException(nameof(idRetriever));
68+
ArgumentNullException.ThrowIfNull(idRetriever);
6969
object[] id = idRetriever(entity);
7070
DbContext.Set<T>().Add(entity);
7171
_unseeder.Add(new UnseedInfo(typeof(T), () => id));
@@ -119,8 +119,7 @@ protected void Create<T>(T entity, EntityIdRetriever<T> idRetriever) where T : c
119119
protected T FindRequiredCreated<T>(Func<T, bool> predicate) where T : class
120120
{
121121
T? entity = FindCreated(predicate);
122-
if (entity is null) throw new InvalidOperationException("Entity could not be found");
123-
return entity;
122+
return entity ?? throw new InvalidOperationException("Entity could not be found");
124123
}
125124

126125
/// <summary>
@@ -133,7 +132,6 @@ protected T FindRequiredCreated<T>(Func<T, bool> predicate) where T : class
133132
protected T FindRequiredCreated<T>(params object[] keyValues) where T : class
134133
{
135134
T? entity = FindCreated<T>(keyValues);
136-
if (entity is null) throw new InvalidOperationException("Entity could not be found");
137-
return entity;
135+
return entity ?? throw new InvalidOperationException("Entity could not be found");
138136
}
139137
}

src/RapidIntegrationTesting.xUnit/RapidIntegrationTesting.xUnit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="xunit.extensibility.execution" Version="2.6.1" />
12+
<PackageReference Include="xunit.extensibility.execution" Version="2.6.6" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/RapidIntegrationTesting/Auth/TestAuthHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ internal sealed class TestAuthHandler : AuthenticationHandler<AuthenticationSche
1515
private readonly List<Claim> _defaultUserClaims = new() { new Claim(AuthConstants.JwtNameClaim, WebAppFactoryAuthOptions.DefaultTestUserName) };
1616
private readonly WebAppFactoryAuthOptions _options;
1717

18-
public TestAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, WebAppFactoryAuthOptions authOptions)
19-
: base(options, logger, encoder, clock) =>
18+
public TestAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, WebAppFactoryAuthOptions authOptions)
19+
: base(options, logger, encoder) =>
2020
_options = authOptions ?? throw new ArgumentNullException(nameof(authOptions));
2121

2222
protected override Task<AuthenticateResult> HandleAuthenticateAsync()

src/RapidIntegrationTesting/RapidIntegrationTesting.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.14" />
9-
<PackageReference Include="Testcontainers" Version="3.6.0" />
10-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.14" />
8+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.1" />
9+
<PackageReference Include="Testcontainers" Version="3.7.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.1" />
1111
</ItemGroup>
1212

1313
<PropertyGroup>

src/RapidIntegrationTesting/RapidIntegrationTesting.xml

Lines changed: 41 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/RapidIntegrationTesting/SignalR/SignalRCallbackDescriptorExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class SignalRCallbackDescriptorExtensions
1515
/// <exception cref="ArgumentNullException"></exception>
1616
public static void RegisterDescriptors(this HubConnection hubConnection, params ISignalRCallbackDescriptor[] descriptors)
1717
{
18-
if (descriptors == null) throw new ArgumentNullException(nameof(descriptors));
18+
ArgumentNullException.ThrowIfNull(descriptors);
1919
foreach (ISignalRCallbackDescriptor signalrCallbackDescriptor in descriptors)
2020
signalrCallbackDescriptor.Setup(hubConnection);
2121
}
@@ -30,7 +30,7 @@ public static void RegisterDescriptors(this HubConnection hubConnection, params
3030
/// <exception cref="ArgumentNullException"></exception>
3131
public static HubConnection Build(this IHubConnectionBuilder builder, params ISignalRCallbackDescriptor[] descriptors)
3232
{
33-
if (builder == null) throw new ArgumentNullException(nameof(builder));
33+
ArgumentNullException.ThrowIfNull(builder);
3434
HubConnection hubConnection = builder.Build();
3535
hubConnection.RegisterDescriptors(descriptors);
3636
return hubConnection;

0 commit comments

Comments
 (0)