-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7610508
commit 843b883
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Threading.Tasks; | ||
using EsamiOnline.Services; | ||
using Grpc.Core; | ||
using JetBrains.Annotations; | ||
using Moq; | ||
using Xunit; | ||
|
||
namespace EsamiOnline.Tests.Services; | ||
|
||
[TestSubject(typeof(GreeterService))] | ||
public class GreeterServiceTest | ||
{ | ||
[Fact] | ||
public async Task SayHelloTest() | ||
{ | ||
// Arrange | ||
var service = new GreeterService(); | ||
var request = new HelloRequest { Name = "Alice" }; | ||
var mockContext = new Mock<ServerCallContext>(); | ||
|
||
// Act | ||
var reply = await service.SayHello(request, mockContext.Object); | ||
|
||
// Assert | ||
Assert.Equal("Hello Alice", reply.Message); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using Grpc.Core; | ||
using EsamiOnline; | ||
|
||
namespace EsamiOnline.Services; | ||
|
||
|