Skip to content

Commit

Permalink
Add Shared to Docker, Refine test exceptions, Update Actions version
Browse files Browse the repository at this point in the history
  • Loading branch information
sentemon committed Nov 8, 2024
1 parent a6750cc commit d5ccc16
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

Expand All @@ -41,7 +41,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
Expand Down
1 change: 1 addition & 0 deletions backend/src/PostService/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ COPY ["src/PostService/PostService.Application/PostService.Application.csproj",
COPY ["src/PostService/PostService.Domain/PostService.Domain.csproj", "src/PostService/PostService.Domain/"]
COPY ["src/PostService/PostService.Infrastructure/PostService.Infrastructure.csproj", "src/PostService/PostService.Infrastructure/"]
COPY ["src/PostService/PostService.Persistence/PostService.Persistence.csproj", "src/PostService/PostService.Persistence/"]
COPY ["src/Shared/Shared.Application/Shared.Application.csproj", "src/Shared/Shared.Application/"]

RUN dotnet restore "src/PostService/PostService.Api/PostService.Api.csproj"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void Constructor_ShouldThrowArgumentException_WhenPostIdIsEmpty()

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("PostId cannot be empty. (Parameter 'postId')")
.WithMessage($"PostId cannot be empty. (Parameter '{nameof(postId)}')")
.And.ParamName.Should().Be("postId");
}

Expand All @@ -55,7 +55,7 @@ public void Constructor_ShouldThrowArgumentException_WhenUserIdIsEmpty()

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("UserId cannot be empty. (Parameter 'userId')")
.WithMessage($"UserId cannot be empty. (Parameter '{nameof(userId)}')")
.And.ParamName.Should().Be("userId");
}

Expand All @@ -72,7 +72,7 @@ public void Constructor_ShouldThrowArgumentException_WhenContentIsEmpty()

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("Content cannot be empty or whitespace. (Parameter 'content')")
.WithMessage($"Content cannot be empty or whitespace. (Parameter '{nameof(content)}')")
.And.ParamName.Should().Be("content");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void Constructor_ShouldThrowArgumentException_WhenPostIdIsEmpty()

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("PostId cannot be empty. (Parameter 'postId')")
.WithMessage($"PostId cannot be empty. (Parameter '{nameof(postId)}')")
.And.ParamName.Should().Be("postId");
}

Expand All @@ -51,7 +51,7 @@ public void Constructor_ShouldThrowArgumentException_WhenUserIdIsEmpty()

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("UserId cannot be empty. (Parameter 'userId')")
.WithMessage($"UserId cannot be empty. (Parameter '{nameof(userId)}')")
.And.ParamName.Should().Be("userId");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void Constructor_ShouldThrowArgumentException_WhenUserIdIsEmpty()

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("UserId cannot be empty. (Parameter 'userId')")
.WithMessage($"UserId cannot be empty. (Parameter '{nameof(userId)}')")
.And.ParamName.Should().Be("userId");
}

Expand All @@ -163,7 +163,7 @@ public void Constructor_ShouldThrowArgumentException_WhenTitleIsEmpty_ForTextCon

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("Title cannot be empty for text content. (Parameter 'title')")
.WithMessage($"Title cannot be empty for text content. (Parameter '{nameof(title)}')")
.And.ParamName.Should().Be("title");
}

Expand All @@ -182,7 +182,7 @@ public void Constructor_ShouldThrowArgumentException_WhenDescriptionIsEmpty_ForT

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("Description cannot be empty for text content. (Parameter 'description')")
.WithMessage($"Description cannot be empty for text content. (Parameter '{nameof(description)}')")
.And.ParamName.Should().Be("description");
}

Expand All @@ -201,7 +201,7 @@ public void Constructor_ShouldThrowArgumentException_WhenContentUrlIsEmpty_ForIm

// Assert
act.Should().ThrowExactly<ArgumentException>()
.WithMessage("ContentUrl is required for image or video content. (Parameter 'contentUrl')")
.WithMessage($"ContentUrl is required for image or video content. (Parameter '{nameof(contentUrl)}')")
.And.ParamName.Should().Be("contentUrl");
}
}

0 comments on commit d5ccc16

Please sign in to comment.