public void GetCarrierConstant2()
        {
            Mock <CarrierConstantService.CarrierConstantServiceClient> mockGrpcClient = new Mock <CarrierConstantService.CarrierConstantServiceClient>(MockBehavior.Strict);
            GetCarrierConstantRequest request = new GetCarrierConstantRequest
            {
                ResourceName = new CarrierConstantName("[CARRIER_CONSTANT]").ToString(),
            };
            CarrierConstant expectedResponse = new CarrierConstant
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCarrierConstant(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CarrierConstantServiceClient client = new CarrierConstantServiceClientImpl(mockGrpcClient.Object, null);
            CarrierConstant response            = client.GetCarrierConstant(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Example #2
0
        public void GetCarrierConstant()
        {
            moq::Mock <CarrierConstantService.CarrierConstantServiceClient> mockGrpcClient = new moq::Mock <CarrierConstantService.CarrierConstantServiceClient>(moq::MockBehavior.Strict);
            GetCarrierConstantRequest request = new GetCarrierConstantRequest
            {
                ResourceNameAsCarrierConstantName = gagvr::CarrierConstantName.FromCarrierConstant("[CARRIER_CONSTANT]"),
            };
            gagvr::CarrierConstant expectedResponse = new gagvr::CarrierConstant
            {
                ResourceNameAsCarrierConstantName = gagvr::CarrierConstantName.FromCarrierConstant("[CARRIER_CONSTANT]"),
                Id = -6774108720365892680L,
                CarrierConstantName = gagvr::CarrierConstantName.FromCarrierConstant("[CARRIER_CONSTANT]"),
                CountryCode         = "country_code8debec55",
            };

            mockGrpcClient.Setup(x => x.GetCarrierConstant(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CarrierConstantServiceClient client   = new CarrierConstantServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::CarrierConstant       response = client.GetCarrierConstant(request.ResourceName);

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