public void UpdateRowRequestObject() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); UpdateRowRequest request = new UpdateRowRequest { Row = new Row(), UpdateMask = new wkt::FieldMask(), View = View.ColumnIdView, }; Row expectedResponse = new Row { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), Values = { { "key8a0b6e3c", new wkt::Value() }, }, }; mockGrpcClient.Setup(x => x.UpdateRow(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); Row response = client.UpdateRow(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void CreateRow() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); CreateRowRequest request = new CreateRowRequest { Parent = "parent7858e4d0", Row = new Row(), }; Row expectedResponse = new Row { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), Values = { { "key8a0b6e3c", new wkt::Value() }, }, }; mockGrpcClient.Setup(x => x.CreateRow(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); Row response = client.CreateRow(request.Parent, request.Row); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task UpdateRowRequestObjectAsync() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); UpdateRowRequest request = new UpdateRowRequest { Row = new Row(), UpdateMask = new wkt::FieldMask(), View = View.ColumnIdView, }; Row expectedResponse = new Row { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), Values = { { "key8a0b6e3c", new wkt::Value() }, }, }; mockGrpcClient.Setup(x => x.UpdateRowAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Row>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); Row responseCallSettings = await client.UpdateRowAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Row responseCancellationToken = await client.UpdateRowAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetRow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetRowResourceNames() { // Create client TablesServiceClient tablesServiceClient = TablesServiceClient.Create(); // Initialize request argument(s) RowName name = RowName.FromTableRow("[TABLE]", "[ROW]"); // Make the request Row response = tablesServiceClient.GetRow(name); }
/// <summary>Snippet for DeleteRowAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task DeleteRowResourceNamesAsync() { // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) RowName name = RowName.FromTableRow("[TABLE]", "[ROW]"); // Make the request await tablesServiceClient.DeleteRowAsync(name); }
public BottomRowPanel(RowName row, float xStart, float width) { type = row; this.width = width; this.xStart = xStart; dragging = false; if (row == RowName.Graph) { graph = new Panel_Graph(); } }
/// <summary>Snippet for DeleteRow</summary> public void DeleteRowResourceNames() { // Snippet: DeleteRow(RowName, CallSettings) // Create client TablesServiceClient tablesServiceClient = TablesServiceClient.Create(); // Initialize request argument(s) RowName name = RowName.FromTableRow("[TABLE]", "[ROW]"); // Make the request tablesServiceClient.DeleteRow(name); // End snippet }
/// <summary>Snippet for DeleteRowAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task DeleteRowRequestObjectAsync() { // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) DeleteRowRequest request = new DeleteRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), }; // Make the request await tablesServiceClient.DeleteRowAsync(request); }
/// <summary>Snippet for GetRow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetRowRequestObject() { // Create client TablesServiceClient tablesServiceClient = TablesServiceClient.Create(); // Initialize request argument(s) GetRowRequest request = new GetRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), View = View.Unspecified, }; // Make the request Row response = tablesServiceClient.GetRow(request); }
/// <summary>Snippet for DeleteRow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void DeleteRowRequestObject() { // Create client TablesServiceClient tablesServiceClient = TablesServiceClient.Create(); // Initialize request argument(s) DeleteRowRequest request = new DeleteRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), }; // Make the request tablesServiceClient.DeleteRow(request); }
/// <summary>Snippet for DeleteRowAsync</summary> public async Task DeleteRowResourceNamesAsync() { // Snippet: DeleteRowAsync(RowName, CallSettings) // Additional: DeleteRowAsync(RowName, CancellationToken) // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) RowName name = RowName.FromTableRow("[TABLE]", "[ROW]"); // Make the request await tablesServiceClient.DeleteRowAsync(name); // End snippet }
public void DeleteRowResourceNames() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); DeleteRowRequest request = new DeleteRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteRow(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); client.DeleteRow(request.RowName); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for BatchDeleteRows</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void BatchDeleteRowsRequestObject() { // Create client TablesServiceClient tablesServiceClient = TablesServiceClient.Create(); // Initialize request argument(s) BatchDeleteRowsRequest request = new BatchDeleteRowsRequest { ParentAsTableName = TableName.FromTable("[TABLE]"), RowNames = { RowName.FromTableRow("[TABLE]", "[ROW]"), }, }; // Make the request tablesServiceClient.BatchDeleteRows(request); }
/// <summary>Snippet for DeleteRowAsync</summary> public async Task DeleteRowRequestObjectAsync() { // Snippet: DeleteRowAsync(DeleteRowRequest, CallSettings) // Additional: DeleteRowAsync(DeleteRowRequest, CancellationToken) // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) DeleteRowRequest request = new DeleteRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), }; // Make the request await tablesServiceClient.DeleteRowAsync(request); // End snippet }
/// <summary>Snippet for GetRowAsync</summary> public async Task GetRowRequestObjectAsync() { // Snippet: GetRowAsync(GetRowRequest, CallSettings) // Additional: GetRowAsync(GetRowRequest, CancellationToken) // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) GetRowRequest request = new GetRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), View = View.Unspecified, }; // Make the request Row response = await tablesServiceClient.GetRowAsync(request); // End snippet }
public async stt::Task DeleteRowResourceNamesAsync() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); DeleteRowRequest request = new DeleteRowRequest { RowName = RowName.FromTableRow("[TABLE]", "[ROW]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteRowAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteRowAsync(request.RowName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteRowAsync(request.RowName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }
public void BatchDeleteRowsRequestObject() { moq::Mock <TablesService.TablesServiceClient> mockGrpcClient = new moq::Mock <TablesService.TablesServiceClient>(moq::MockBehavior.Strict); BatchDeleteRowsRequest request = new BatchDeleteRowsRequest { ParentAsTableName = TableName.FromTable("[TABLE]"), RowNames = { RowName.FromTableRow("[TABLE]", "[ROW]"), }, }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.BatchDeleteRows(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TablesServiceClient client = new TablesServiceClientImpl(mockGrpcClient.Object, null); client.BatchDeleteRows(request); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for BatchDeleteRowsAsync</summary> public async Task BatchDeleteRowsRequestObjectAsync() { // Snippet: BatchDeleteRowsAsync(BatchDeleteRowsRequest, CallSettings) // Additional: BatchDeleteRowsAsync(BatchDeleteRowsRequest, CancellationToken) // Create client TablesServiceClient tablesServiceClient = await TablesServiceClient.CreateAsync(); // Initialize request argument(s) BatchDeleteRowsRequest request = new BatchDeleteRowsRequest { ParentAsTableName = TableName.FromTable("[TABLE]"), RowNames = { RowName.FromTableRow("[TABLE]", "[ROW]"), }, }; // Make the request await tablesServiceClient.BatchDeleteRowsAsync(request); // End snippet }
public DataTable Pivot( DataTable src, string VerticalColumnName, string HorizontalColumnName, string ValueColumnName) { DataTable dst = new DataTable(); if (src == null || src.Rows.Count == 0) { return(dst); } // find all distinct names for column and row ArrayList ColumnValues = new ArrayList(); ArrayList RowValues = new ArrayList(); foreach (DataRow dr in src.Rows) { // find all column values object column = dr[VerticalColumnName]; if (!ColumnValues.Contains(column)) { ColumnValues.Add(column); } //find all row values object row = dr[HorizontalColumnName]; if (!RowValues.Contains(row)) { RowValues.Add(row); } } ColumnValues.Sort(); RowValues.Sort(); //create columns dst = new DataTable(); dst.Columns.Add(VerticalColumnName, src.Columns[VerticalColumnName].DataType); Type t = src.Columns[ValueColumnName].DataType; foreach (object ColumnNameInRow in RowValues) { dst.Columns.Add(ColumnNameInRow.ToString(), t); } //create destination rows foreach (object RowName in ColumnValues) { DataRow NewRow = dst.NewRow(); NewRow[VerticalColumnName] = RowName.ToString(); dst.Rows.Add(NewRow); } //fill out pivot table foreach (DataRow drSource in src.Rows) { object key = drSource[VerticalColumnName]; string ColumnNameInRow = Convert.ToString(drSource[HorizontalColumnName]); int index = ColumnValues.IndexOf(key); dst.Rows[index][ColumnNameInRow] = sum(dst.Rows[index][ColumnNameInRow], drSource[ValueColumnName]); } return(dst); }
public string ConvertCoordinatesToShapeName(Vertex[] vertices) { ColNumber = SetColumnNumber(); RowName = SetRowName(); return(RowName.ToString() + ColNumber); }