Skip to content

Commit

Permalink
Merge pull request #49 from nanotaboada/feature/csharpier
Browse files Browse the repository at this point in the history
chore: adjusted formatting to CSharpier rules
  • Loading branch information
nanotaboada authored Apr 1, 2024
2 parents 9e5fe53 + 451f0af commit 1f54fcc
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 216 deletions.
47 changes: 22 additions & 25 deletions Dotnet.AspNetCore.Samples.WebApi.Tests/PlayerServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ public PlayerServiceTests()
using var dbCommand = context.Database.GetDbConnection().CreateCommand();

dbCommand.CommandText = """
CREATE TABLE IF NOT EXISTS "players"
(
"id" INTEGER,
"firstName" TEXT NOT NULL,
"middleName" TEXT,
"lastName" TEXT NOT NULL,
"dateOfBirth" TEXT,
"squadNumber" INTEGER NOT NULL,
"position" TEXT NOT NULL,
"abbrPosition" TEXT,
"team" TEXT,
"league" TEXT,
"starting11" BOOLEAN,
PRIMARY KEY("id")
);
""";
CREATE TABLE IF NOT EXISTS "players"
(
"id" INTEGER,
"firstName" TEXT NOT NULL,
"middleName" TEXT,
"lastName" TEXT NOT NULL,
"dateOfBirth" TEXT,
"squadNumber" INTEGER NOT NULL,
"position" TEXT NOT NULL,
"abbrPosition" TEXT,
"team" TEXT,
"league" TEXT,
"starting11" BOOLEAN,
PRIMARY KEY("id")
);
""";

dbCommand.ExecuteNonQuery();
}

Expand All @@ -58,6 +58,7 @@ PRIMARY KEY("id")
}

PlayerContext CreatePlayerContext() => new PlayerContext(dbContextOptions);

public void Dispose() => dbConnection.Dispose();

[Fact]
Expand Down Expand Up @@ -140,14 +141,10 @@ private static ILogger<PlayerService> CreateLoggerMock()
private static IMemoryCache CreateMemoryCacheMock(object? value)
{
var mock = new Mock<IMemoryCache>();

mock
.Setup(x => x.TryGetValue(It.IsAny<object>(), out value))
.Returns(true);

mock
.Setup(x => x.CreateEntry(It.IsAny<object>()))
.Returns(Mock.Of<ICacheEntry>);

mock.Setup(x => x.TryGetValue(It.IsAny<object>(), out value)).Returns(true);

mock.Setup(x => x.CreateEntry(It.IsAny<object>())).Returns(Mock.Of<ICacheEntry>);

return mock.Object;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Dotnet.AspNetCore.Samples.WebApi.Models;
using Dotnet.AspNetCore.Samples.WebApi.Services;
using Microsoft.AspNetCore.Mvc;

namespace Dotnet.AspNetCore.Samples.WebApi.Controllers;

Expand All @@ -10,7 +10,7 @@ Scaffolded with dotnet-aspnet-codegenerator
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/tools/dotnet-aspnet-codegenerator
dotnet aspnet-codegenerator controller -name PlayersController \
-async -api --model Player --dataContext PlayerContext \
-async -api --model Player --dataContext PlayerContext \
-outDir Controllers
---------------------------------------------------------------------------------------------------
*/
Expand Down Expand Up @@ -60,7 +60,7 @@ HTTP GET
public async Task<ActionResult<IEnumerable<Player>>> GetPlayers()
{
var players = await _playerService.RetrieveAsync();

if (players.Any())
{
return players;
Expand Down
Loading

0 comments on commit 1f54fcc

Please sign in to comment.