public void GetMobileDeviceConstant2() { Mock <MobileDeviceConstantService.MobileDeviceConstantServiceClient> mockGrpcClient = new Mock <MobileDeviceConstantService.MobileDeviceConstantServiceClient>(MockBehavior.Strict); GetMobileDeviceConstantRequest request = new GetMobileDeviceConstantRequest { ResourceName = new MobileDeviceConstantName("[MOBILE_DEVICE_CONSTANT]").ToString(), }; MobileDeviceConstant expectedResponse = new MobileDeviceConstant { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetMobileDeviceConstant(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); MobileDeviceConstantServiceClient client = new MobileDeviceConstantServiceClientImpl(mockGrpcClient.Object, null); MobileDeviceConstant response = client.GetMobileDeviceConstant(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetMobileDeviceConstant() { moq::Mock <MobileDeviceConstantService.MobileDeviceConstantServiceClient> mockGrpcClient = new moq::Mock <MobileDeviceConstantService.MobileDeviceConstantServiceClient>(moq::MockBehavior.Strict); GetMobileDeviceConstantRequest request = new GetMobileDeviceConstantRequest { ResourceNameAsMobileDeviceConstantName = gagvr::MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"), }; gagvr::MobileDeviceConstant expectedResponse = new gagvr::MobileDeviceConstant { ResourceNameAsMobileDeviceConstantName = gagvr::MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"), Type = gagve::MobileDeviceTypeEnum.Types.MobileDeviceType.Tablet, Id = -6774108720365892680L, MobileDeviceConstantName = gagvr::MobileDeviceConstantName.FromCriterion("[CRITERION_ID]"), ManufacturerName = "manufacturer_name23641b86", OperatingSystemName = "operating_system_namea90f0a1e", }; mockGrpcClient.Setup(x => x.GetMobileDeviceConstant(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); MobileDeviceConstantServiceClient client = new MobileDeviceConstantServiceClientImpl(mockGrpcClient.Object, null); gagvr::MobileDeviceConstant response = client.GetMobileDeviceConstant(request.ResourceName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }