예제 #1
0
        public void VerifyNotificationChannel()
        {
            Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict);
            VerifyNotificationChannelRequest expectedRequest = new VerifyNotificationChannelRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
                Code = "code3059181",
            };
            NotificationChannel expectedResponse = new NotificationChannel
            {
                Type        = "type3575610",
                Name        = "name2-1052831874",
                DisplayName = "displayName1615086568",
                Description = "description-1724546052",
            };

            mockGrpcClient.Setup(x => x.VerifyNotificationChannel(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null);
            NotificationChannelName          name   = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
            string code = "code3059181";
            NotificationChannel response = client.VerifyNotificationChannel(name, code);

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