Skip to content

Commit

Permalink
fix: warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HamedSY committed Jul 17, 2024
1 parent cd7b5eb commit 0dd8dea
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public void Validate_ShouldReturnEmptyRepositoryNameErrorCode_WhenRepositoryName
// Arrange
var command = new CreateBranchCommand
{
RepositoryName = repositoryName
RepositoryName = repositoryName,
NewBranchName = "new_branch",
OldReferenceName = "old_ref"
};

// Act
Expand All @@ -42,7 +44,9 @@ public void Validate_ShouldReturnEmptyNewBranchNameErrorCode_WhenNewBranchNameIs
// Arrange
var command = new CreateBranchCommand
{
NewBranchName = newBranchName
RepositoryName = "repo",
NewBranchName = newBranchName,
OldReferenceName = "old_ref"
};

// Act
Expand All @@ -61,6 +65,8 @@ public void Validate_ShouldReturnEmptyOldReferenceNameErrorCode_WhenOldReference
// Arrange
var command = new CreateBranchCommand
{
RepositoryName = "repo",
NewBranchName = "new_branch",
OldReferenceName = oldReferenceName
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace Mohaymen.GiteaClient.Gitea.Branch.CreateBranch.Commands;

internal class CreateBranchCommand : IRequest<ApiResponse<CreateBranchResponseDto>>
{
public string RepositoryName { get; init; }
public string NewBranchName { get; init; }
public string OldReferenceName { get; init; }
public required string RepositoryName { get; init; }
public required string NewBranchName { get; init; }
public required string OldReferenceName { get; init; }
}

internal class CreateBranchCommandHandler : IRequestHandler<CreateBranchCommand, ApiResponse<CreateBranchResponseDto>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace Mohaymen.GiteaClient.Gitea.Branch.CreateBranch.Context;
public class CreateBranchRequest
{
[JsonProperty("new_branch_name")]
public string NewBranchName { get; init; }
public required string NewBranchName { get; init; }

[JsonProperty("old_ref_name")]
public string OldReferenceName { get; init; }
public required string OldReferenceName { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class CreateBranchCommandDto
{
public string RepositoryName { get; init; }
public string NewBranchName { get; init; }
public string OldReferenceName { get; init; }
public required string RepositoryName { get; init; }
public required string NewBranchName { get; init; }
public required string OldReferenceName { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Mohaymen.GiteaClient.Gitea.Branch.CreateBranch.Dtos;
public class CreateBranchResponseDto
{
[JsonProperty("name")]
public string BranchName { get; init; }
public required string BranchName { get; init; }
}

0 comments on commit 0dd8dea

Please sign in to comment.