예제 #1
0
        public void GetNotificationChannelVerificationCode2()
        {
            Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict);
            GetNotificationChannelVerificationCodeRequest request = new GetNotificationChannelVerificationCodeRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            GetNotificationChannelVerificationCodeResponse expectedResponse = new GetNotificationChannelVerificationCodeResponse
            {
                Code = "code3059181",
            };

            mockGrpcClient.Setup(x => x.GetNotificationChannelVerificationCode(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null);
            GetNotificationChannelVerificationCodeResponse response = client.GetNotificationChannelVerificationCode(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }