Esempio n. 1
0
        public void UpdateSettingsRequestObject()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            UpdateSettingsRequest request = new UpdateSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Settings   = new Settings(),
            };
            Settings expectedResponse = new Settings
            {
                Notifications =
                {
                    new Settings.Types.Notification(),
                },
            };

            mockGrpcClient.Setup(x => x.UpdateSettings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlertCenterServiceClient client = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            Settings response = client.UpdateSettings(request);

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