Skip to content

Commit

Permalink
Merge branch 'update-backend'
Browse files Browse the repository at this point in the history
  • Loading branch information
leddt committed Aug 26, 2023
2 parents d2b0d4e + 238f57b commit 9862576
Show file tree
Hide file tree
Showing 19 changed files with 1,063 additions and 125 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build

RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
Expand Down
16 changes: 8 additions & 8 deletions LetsGame.Tests/LetsGame.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoMoqCore" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="AutoMoqCore" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
16 changes: 8 additions & 8 deletions LetsGame.Tests/Services/GroupServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public async Task CreateGroupCreatesTheGroupAndAssignsTheCurrentUserAsOwner()

Assert.Equal("Test group", group.Name);
Assert.Equal("test-group", group.Slug);
Assert.Equal(1, group.Memberships.Count);
Assert.Equal(_currentUser, group.Memberships.First().User);
Assert.Equal(GroupRole.Owner, group.Memberships.First().Role);
var membership = Assert.Single(group.Memberships);
Assert.Equal(_currentUser, membership.User);
Assert.Equal(GroupRole.Owner, membership.Role);
}

[Fact]
Expand Down Expand Up @@ -147,7 +147,7 @@ public async Task AddGameToGroupDoesNothingIfGroupAlreadyHasThisGame()

await _sut.AddGameToGroupAsync(group.Id, 42);

Assert.Equal(1, group.Games.Count);
Assert.Single(group.Games);
}

[Fact]
Expand All @@ -162,8 +162,8 @@ public async Task AddSlotVoteAddsVoteForCurrentUser()
.Include(x => x.Votes).ThenInclude(x => x.Voter)
.FirstOrDefaultAsync(x => x.Id == slot.Id);

Assert.Equal(1, slot.Votes.Count);
Assert.Equal(_currentUser, slot.Votes.First().Voter);
var vote = Assert.Single(slot.Votes);
Assert.Equal(_currentUser, vote.Voter);
}

[Fact]
Expand All @@ -181,7 +181,7 @@ public async Task AddSlotVoteDoesNothingIfUserNotMemberOfGroup()
.Include(x => x.Votes).ThenInclude(x => x.Voter)
.FirstOrDefaultAsync(x => x.Id == slot.Id);

Assert.Equal(0, slot.Votes.Count);
Assert.Empty(slot.Votes);
}

[Fact]
Expand All @@ -198,7 +198,7 @@ public async Task AddSlotVoteDoesNothingIfUserAlreadyVoted()
.Include(x => x.Votes).ThenInclude(x => x.Voter)
.FirstOrDefaultAsync(x => x.Id == slot.Id);

Assert.Equal(1, slot.Votes.Count);
Assert.Single(slot.Votes);
}

[Fact]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions LetsGame.Web/Data/Migrations/20210117031605_invites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace LetsGame.Web.Data.Migrations
{
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
public partial class invites : Migration
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions LetsGame.Web/Data/Migrations/20210117203924_cantplays.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace LetsGame.Web.Data.Migrations
{
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
public partial class cantplays : Migration
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions LetsGame.Web/Data/Migrations/20210205000825_unsubscribes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace LetsGame.Web.Data.Migrations
{
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
public partial class unsubscribes : Migration
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Expand Down
Loading

0 comments on commit 9862576

Please sign in to comment.