hello-shop/tests/HelloShop.BasketService.FunctionalTests/GreeterServiceIntegrationTest.cs
2024-07-11 20:57:59 +08:00

26 lines
756 B
C#

// Copyright (c) HelloShop Corporation. All rights reserved.
// See the license file in the project root for more information.
using Grpc.Net.Client;
using HelloShop.BasketService.Protos;
namespace HelloShop.BasketService.FunctionalTests
{
public class GreeterServiceIntegrationTest
{
[Fact]
public async Task SayHelloReturnsHelloMessage()
{
// Arrange
using var channel = GrpcChannel.ForAddress(GrpcConstants.GrpcAddress);
var client = new Greeter.GreeterClient(channel);
// Act
var reply = await client.SayHelloAsync(new HelloRequest { Name = "Greeter" });
// Assert
Assert.Equal("Hello Greeter", reply.Message);
}
}
}