测试 gRPC 购物车服务
This commit is contained in:
1 parent
c192d209fd
commit
680ce10fa7
12 files changed
+494
-3
No files matched your search
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
using HelloShop.BasketService.Protos;
|
||||
using HelloShop.BasketService.Services;
|
||||
using HelloShop.BasketService.UnitTests.Helpers;
|
||||
|
||||
namespace HelloShop.BasketService.UnitTests.Services
|
||||
{
|
||||
public class GreeterServiceTest
|
||||
{
|
||||
[Fact]
|
||||
public async Task SayHelloReturnsCorrectMessage()
|
||||
{
|
||||
// Arrange
|
||||
var service = new GreeterService();
|
||||
var request = new HelloRequest { Name = "World" };
|
||||
|
||||
// Act
|
||||
var response = await service.SayHello(request, TestServerCallContext.Create());
|
||||
|
||||
// Assert
|
||||
Assert.Equal("Hello World", response.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user