Skip to content

Commit fef32da

Browse files
Merge pull request #132 from nullinside-development-group/chore/formatting
chore: formatting
2 parents a078ee9 + 335851b commit fef32da

18 files changed

+58
-57
lines changed

src/Nullinside.Api.Common.AspNetCore/Nullinside.Api.Common.AspNetCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<PrivateAssets>all</PrivateAssets>
2323
</PackageReference>
2424
<PackageReference Include="Nullinside.MySql.EntityFrameworkCore" Version="9.0.3"/>
25-
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.5" />
26-
<PackageReference Include="System.Text.Json" Version="9.0.9" />
25+
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.5"/>
26+
<PackageReference Include="System.Text.Json" Version="9.0.9"/>
2727
</ItemGroup>
2828

2929
<ItemGroup>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"
1+
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2+
xmlns:s="clr-namespace:System;assembly=mscorlib"
23
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
34
xml:space="preserve">
45
<s:String x:Key="/Default/CodeInspection/Daemon/ConfigureAwaitAnalysisMode/@EntryValue">Library</s:String></wpf:ResourceDictionary>

src/Nullinside.Api.Common/Nullinside.Api.Common.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="log4net" Version="3.2.0" />
22-
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.9" />
23-
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
21+
<PackageReference Include="log4net" Version="3.2.0"/>
22+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.9"/>
23+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4"/>
2424
<PackageReference Include="SSH.NET" Version="2025.0.0"/>
2525
<PackageReference Include="TwitchLib.Api" Version="3.9.0"/>
2626
<PackageReference Include="TwitchLib.Client" Version="3.4.0"/>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"
1+
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2+
xmlns:s="clr-namespace:System;assembly=mscorlib"
23
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
34
xml:space="preserve">
45
<s:String x:Key="/Default/CodeInspection/Daemon/ConfigureAwaitAnalysisMode/@EntryValue">Library</s:String></wpf:ResourceDictionary>

src/Nullinside.Api.Model/Ddl/ITableModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ public interface ITableModel {
1010
/// The method used to configure the POCOs of the table.
1111
/// </summary>
1212
/// <param name="modelBuilder">The model builder.</param>
13-
public void OnModelCreating(ModelBuilder modelBuilder);
13+
void OnModelCreating(ModelBuilder modelBuilder);
1414
}

src/Nullinside.Api.Model/Ddl/User.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public class User : ITableModel {
2727
/// The user's auth token for interacting with the site's API.
2828
/// </summary>
2929
public string? Token { get; set; }
30-
30+
3131
/// <summary>
3232
/// The user's auth token for interacting with the site's API.
3333
/// </summary>
3434
public string? RefreshToken { get; set; }
35-
35+
3636
/// <summary>
3737
/// The user's auth token for interacting with the site's API.
3838
/// </summary>

src/Nullinside.Api.Model/Nullinside.Api.Model.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.9" />
20+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.9"/>
2121
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.9">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>
2424
</PackageReference>
2525
<PackageReference Include="Nullinside.MySql.EntityFrameworkCore" Version="9.0.3"/>
26-
<PackageReference Include="System.Text.Json" Version="9.0.9" />
26+
<PackageReference Include="System.Text.Json" Version="9.0.9"/>
2727
</ItemGroup>
2828

2929
<ItemGroup>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"
1+
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2+
xmlns:s="clr-namespace:System;assembly=mscorlib"
23
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
34
xml:space="preserve">
45
<s:String x:Key="/Default/CodeInspection/Daemon/ConfigureAwaitAnalysisMode/@EntryValue">Library</s:String></wpf:ResourceDictionary>

src/Nullinside.Api.Model/Shared/UserHelpers.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static class UserHelpers {
2323
/// <param name="twitchUsername">The username of the user on twitch.</param>
2424
/// <param name="twitchId">The id of the user on twitch.</param>
2525
/// <returns>The bearer token if successful, null otherwise.</returns>
26-
public static async Task<OAuthToken?> GenerateTokenAndSaveToDatabase(INullinsideContext dbContext, string email,
26+
public static async Task<OAuthToken?> GenerateTokenAndSaveToDatabase(INullinsideContext dbContext, string email,
2727
TimeSpan tokenExpires, string? authToken = null, string? refreshToken = null, DateTime? expires = null,
2828
string? twitchUsername = null, string? twitchId = null, CancellationToken cancellationToken = new()) {
2929
string bearerToken = AuthUtils.GenerateToken();
@@ -76,9 +76,9 @@ public static class UserHelpers {
7676
}
7777

7878
await dbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
79-
return new() {
80-
AccessToken = bearerToken,
81-
RefreshToken = bearerRefreshToken,
79+
return new OAuthToken {
80+
AccessToken = bearerToken,
81+
RefreshToken = bearerRefreshToken,
8282
ExpiresUtc = expiresUtc
8383
};
8484
}

src/Nullinside.Api.Tests/Nullinside.Api.Model/Shared/UserHelpersTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Nullinside.Api.Common.Auth;
12
using Nullinside.Api.Model.Ddl;
23
using Nullinside.Api.Model.Shared;
34

@@ -23,7 +24,7 @@ public async Task GenerateTokenForExistingUser() {
2324
Assert.That(_db.Users.Count(), Is.EqualTo(1));
2425

2526
// Generate a new token
26-
var token = await UserHelpers.GenerateTokenAndSaveToDatabase(_db, "email", Constants.OAUTH_TOKEN_TIME_LIMIT).ConfigureAwait(false);
27+
OAuthToken? token = await UserHelpers.GenerateTokenAndSaveToDatabase(_db, "email", Constants.OAUTH_TOKEN_TIME_LIMIT).ConfigureAwait(false);
2728
Assert.That(token, Is.Not.Null);
2829

2930
// Verify we still only have one user
@@ -48,7 +49,7 @@ public async Task GenerateTokenForNewUser() {
4849
Assert.That(_db.Users.Count(), Is.EqualTo(1));
4950

5051
// Generate a new token
51-
var token = await UserHelpers.GenerateTokenAndSaveToDatabase(_db, "email", Constants.OAUTH_TOKEN_TIME_LIMIT).ConfigureAwait(false);
52+
OAuthToken? token = await UserHelpers.GenerateTokenAndSaveToDatabase(_db, "email", Constants.OAUTH_TOKEN_TIME_LIMIT).ConfigureAwait(false);
5253
Assert.That(token, Is.Not.Null);
5354

5455
// Verify we have a new user
@@ -65,7 +66,7 @@ public async Task GenerateTokenForNewUser() {
6566
[Test]
6667
public async Task HandleUnexpectedErrors() {
6768
// Force an error to occur.
68-
var token = await UserHelpers.GenerateTokenAndSaveToDatabase(null!, "email", Constants.OAUTH_TOKEN_TIME_LIMIT).ConfigureAwait(false);
69+
OAuthToken? token = await UserHelpers.GenerateTokenAndSaveToDatabase(null!, "email", Constants.OAUTH_TOKEN_TIME_LIMIT).ConfigureAwait(false);
6970
Assert.That(token, Is.Null);
7071
}
7172
}

0 commit comments

Comments
 (0)