=begin #Web API Swagger specification #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.0-SNAPSHOT =end require 'spec_helper' require 'json' # Unit tests for AsposeCellsCloud::CellsApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate describe 'CellsApi' do before do @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl) $VERBOSE = nil end after do # run after each test end # unit tests for cells_delete_worksheet_columns # Delete worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param column_index The column index. # @param columns The columns. # @param update_reference The update reference. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [ColumnsResponse] describe 'cells_delete_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 column_index = 100 columns = 2 update_reference = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_delete_worksheet_columns(name, sheet_name, column_index, columns, update_reference, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_delete_worksheet_row # Delete worksheet row. # # @param name The workbook name. # @param sheet_name The worksheet bame. # @param row_index The row index. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_delete_worksheet_row test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 row_index = 100 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_delete_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_delete_worksheet_rows # Delete several worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet bame. # @param startrow The begin row index to be operated. # @param [Hash] opts the optional parameters # @option opts [Integer] :total_rows Number of rows to be operated. # @option opts [BOOLEAN] :update_reference Indicates if update references in other worksheets. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_delete_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 startrow = 1 total_rows = 1 update_reference = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_delete_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference,:folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_cell # Read cell data by cell's name. # # @param name Document name. # @param sheet_name Worksheet name. # @param cell_or_method_name The cell's or method name. (Method name like firstcell, endcell etc.) # @param [Hash] opts the optional parameters # @option opts [String] :folder Document's folder. # @option opts [String] :storage storage name. # @return [Object] describe 'cells_get_worksheet_cell test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_or_method_name = 'firstcell' folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder}) print(result) #expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_cell_style # Read cell's style info. # # @param name Document name. # @param sheet_name Worksheet name. # @param cell_name Cell's name. # @param [Hash] opts the optional parameters # @option opts [String] :folder Document's folder. # @option opts [String] :storage storage name. # @return [StyleResponse] describe 'cells_get_worksheet_cell_style test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_name = 'C1' folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_cell_style(name, sheet_name, cell_name, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_cells # Get cells info. # # @param name Document name. # @param sheet_name Worksheet name. # @param [Hash] opts the optional parameters # @option opts [Integer] :offest Begginig offset. # @option opts [Integer] :count Maximum amount of cells in the response. # @option opts [String] :folder Document's folder name. # @option opts [String] :storage storage name. # @return [CellsResponse] describe 'cells_get_worksheet_cells test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 offest = 1 count = 3 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_cells(name, sheet_name, {:offest=>offest, :count=>count, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_column # Read worksheet column data by column's index. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param column_index The column index. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [ColumnResponse] describe 'cells_get_worksheet_column test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 column_index = 100 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_column(name, sheet_name, column_index, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_columns # Read worksheet columns info. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workdook folder. # @option opts [String] :storage storage name. # @return [ColumnsResponse] describe 'cells_get_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_columns(name, sheet_name, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_row # Read worksheet row data by row's index. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param row_index The row index. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [RowResponse] describe 'cells_get_worksheet_row test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 row_index = 100 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_worksheet_rows # Read worksheet rows info. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workdook folder. # @option opts [String] :storage storage name. # @return [RowsResponse] describe 'cells_get_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_worksheet_rows(name, sheet_name, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_cell_calculate # Cell calculate formula # # @param name # @param sheet_name # @param cell_name # @param [Hash] opts the optional parameters # @option opts [CalculationOptions] :options # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_cell_calculate test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_name = $CellName options = AsposeCellsCloud::CalculationOptions.new({Recursive:true,IgnoreError:true}) folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_cell_calculate(name, sheet_name, cell_name, { :options=>options,:folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # # unit tests for cells_post_cell_characters # # Set cell characters # # # # @param name # # @param sheet_name # # @param cell_name # # @param [Hash] opts the optional parameters # # @option opts [Array] :options # # @option opts [String] :folder # # @option opts [String] :storage storage name. # # @return [CellsCloudResponse] # describe 'cells_post_cell_characters test' do # it "should work" do # name = $BOOK1 # sheet_name = $SHEET1 # cell_name = $CellName # options = nil # folder = $TEMPFOLDER # storage = nil # result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) # expect(result.uploaded.size).to be > 0 # result = @instance.cells_post_cell_characters(name, sheet_name, cell_name, { :options=>options,:folder=>folder}) # expect(result.code).to eql(200) # # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # end # end # unit tests for cells_post_clear_contents # Clear cells contents. # # @param name Workbook name. # @param sheet_name Worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :range The range. # @option opts [Integer] :start_row The start row. # @option opts [Integer] :start_column The start column. # @option opts [Integer] :end_row The end row. # @option opts [Integer] :end_column The end column. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_clear_contents test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 range = $RANGE start_row = 1 start_column = 1 end_row = 2 end_column = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_clear_contents(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_clear_formats # Clear cells contents. # # @param name Workbook name. # @param sheet_name Worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :range The range. # @option opts [Integer] :start_row The start row. # @option opts [Integer] :start_column The start column. # @option opts [Integer] :end_row The end row. # @option opts [Integer] :end_column The end column. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_clear_formats test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 range = $RANGE start_row = 1 start_column = 1 end_row = 2 end_column = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_clear_formats(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_column_style # Set column style # # @param name The workbook name. # @param sheet_name The worksheet name. # @param column_index The column index. # @param [Hash] opts the optional parameters # @option opts [Style] :style Style dto # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_column_style test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 column_index = 100 style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_column_style(name, sheet_name, column_index, { :style=>style, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_copy_cell_into_cell # Copy cell into cell # # @param name Workbook name. # @param dest_cell_name Destination cell name # @param sheet_name Destination worksheet name. # @param worksheet Source worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :cellname Source cell name # @option opts [Integer] :row Source row # @option opts [Integer] :column Source column # @option opts [String] :folder Folder name # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_copy_cell_into_cell test' do it "should work" do name = $BOOK1 dest_cell_name = 'C1' sheet_name = $SHEET1 worksheet = $SHEET2 cellname = $CellName row = 1 column = 1 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_copy_cell_into_cell(name, dest_cell_name, sheet_name, worksheet, {:cellname=>cellname, :row=>row, :column=>column, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_copy_worksheet_columns # Copy worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param source_column_index Source column index # @param destination_column_index Destination column index # @param column_number The copied column number # @param [Hash] opts the optional parameters # @option opts [String] :worksheet The Worksheet # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_copy_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 source_column_index = 100 destination_column_index = 100 column_number = 1 worksheet = $SHEET2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_copy_worksheet_columns(name, sheet_name, source_column_index, destination_column_index, column_number, { :worksheet=>worksheet,:folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_copy_worksheet_rows # Copy worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param source_row_index Source row index # @param destination_row_index Destination row index # @param row_number The copied row number # @param [Hash] opts the optional parameters # @option opts [String] :worksheet worksheet # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_copy_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 source_row_index = 100 destination_row_index = 100 row_number = 1 worksheet = $SHEET2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_copy_worksheet_rows(name, sheet_name, source_row_index, destination_row_index, row_number, {:worksheet=>worksheet, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_group_worksheet_columns # Group worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param first_index The first column index to be operated. # @param last_index The last column index to be operated. # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :hide columns visible state # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_group_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 first_index = 1 last_index = 4 hide = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_group_worksheet_columns(name, sheet_name, first_index, last_index, { :hide=>hide, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_group_worksheet_rows # Group worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param first_index The first row index to be operated. # @param last_index The last row index to be operated. # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :hide rows visible state # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_group_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 first_index = 1 last_index = 2 hide = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_group_worksheet_rows(name, sheet_name, first_index, last_index, {:hide=>hide, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_hide_worksheet_columns # Hide worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param start_column The begin column index to be operated. # @param total_columns Number of columns to be operated. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_hide_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 start_column = 1 total_columns = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_hide_worksheet_columns(name, sheet_name, start_column, total_columns, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_hide_worksheet_rows # Hide worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param startrow The begin row index to be operated. # @param total_rows Number of rows to be operated. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_hide_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 startrow = 1 total_rows = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_hide_worksheet_rows(name, sheet_name, startrow, total_rows, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_row_style # Set row style. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param row_index The row index. # @param [Hash] opts the optional parameters # @option opts [Style] :style Style dto # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_row_style test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 row_index = 100 style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_row_style(name, sheet_name, row_index, { :style=>style, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_get_cell_html_string # Set htmlstring value into cell # # @param name Workbook name. # @param sheet_name Worksheet name. # @param cell_name The cell name. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellResponse] describe 'cells_get_cell_html_string test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_name = $CellName folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_get_cell_html_string(name, sheet_name, cell_name, { :folder=>folder}) expect(result).not_to be_empty # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_set_cell_html_string # Set htmlstring value into cell # # @param name Workbook name. # @param sheet_name Worksheet name. # @param cell_name The cell name. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellResponse] describe 'cells_post_set_cell_html_string test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_name = $CellName folder = $TEMPFOLDER storage = nil html_string ="sssssssssssssssssssssss" # result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) # expect(result.uploaded.size).to be > 0 result = @instance.cells_post_set_cell_html_string(name, sheet_name, cell_name, html_string, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_set_cell_range_value # Set cell range value # # @param name Workbook name. # @param sheet_name Worksheet name. # @param cellarea Cell area (like \"A1:C2\") # @param value Range value # @param type Value data type (like \"int\") # @param [Hash] opts the optional parameters # @option opts [String] :folder Folder name # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_set_cell_range_value test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cellarea = $CELLAREA value = 1 type = 'string' folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_set_cell_range_value(name, sheet_name, cellarea, value, type, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_set_worksheet_column_width # Set worksheet column width. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param column_index The column index. # @param width The width. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [ColumnResponse] describe 'cells_post_set_worksheet_column_width test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 column_index = 100 width = 10 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_set_worksheet_column_width(name, sheet_name, column_index, width, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_ungroup_worksheet_columns # Ungroup worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param first_index The first column index to be operated. # @param last_index The last column index to be operated. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_ungroup_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 first_index = 1 last_index = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_ungroup_worksheet_columns(name, sheet_name, first_index, last_index, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_ungroup_worksheet_rows # Ungroup worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param first_index The first row index to be operated. # @param last_index The last row index to be operated. # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :is_all Is all row to be operated # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_ungroup_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 first_index = 1 last_index = 10 is_all = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_ungroup_worksheet_rows(name, sheet_name, first_index, last_index, { :is_all=>is_all, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_unhide_worksheet_columns # Unhide worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param startcolumn The begin column index to be operated. # @param total_columns Number of columns to be operated. # @param [Hash] opts the optional parameters # @option opts [Float] :width The new column width. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_unhide_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 startcolumn = 1 total_columns = 2 width = 10 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_unhide_worksheet_columns(name, sheet_name, startcolumn, total_columns, { :width=>width, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_unhide_worksheet_rows # Unhide worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param startrow The begin row index to be operated. # @param total_rows Number of rows to be operated. # @param [Hash] opts the optional parameters # @option opts [Float] :height The new row height. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_unhide_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 startrow = 1 total_rows = 1 height = 10 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_unhide_worksheet_rows(name, sheet_name, startrow, total_rows, {:height=>height, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_update_worksheet_cell_style # Update cell's style. # # @param name Workbook name. # @param sheet_name Worksheet name. # @param cell_name The cell name. # @param [Hash] opts the optional parameters # @option opts [Style] :style with update style settings. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [StyleResponse] describe 'cells_post_update_worksheet_cell_style test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_name = 'A1' style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_update_worksheet_cell_style(name, sheet_name, cell_name,{ :style=>style, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_update_worksheet_range_style # Update cell's range style. # # @param name Workbook name. # @param sheet_name Worksheet name. # @param range The range. # @param [Hash] opts the optional parameters # @option opts [Style] :style with update style settings. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_update_worksheet_range_style test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 range = $RANGE style = AsposeCellsCloud::Style.new folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_update_worksheet_range_style(name, sheet_name, range,{ :style=>style, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_update_worksheet_row # Update worksheet row. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param row_index The row index. # @param [Hash] opts the optional parameters # @option opts [Float] :height The new row height. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [RowResponse] describe 'cells_post_update_worksheet_row test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 row_index = 100 height = 10 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_update_worksheet_row(name, sheet_name, row_index, { :height=>height,:folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_worksheet_cell_set_value # Set cell value. # # @param name The document name. # @param sheet_name The worksheet name. # @param cell_name The cell name. # @param [Hash] opts the optional parameters # @option opts [String] :value The cell value. # @option opts [String] :type The value type. # @option opts [String] :formula Formula for cell # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellResponse] describe 'cells_post_worksheet_cell_set_value test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_name = 'A1' value = 1 type = 'string' formula = nil folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_worksheet_cell_set_value(name, sheet_name, cell_name, {:value=>value, :type=>type, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_worksheet_merge # Merge cells. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param start_row The start row. # @param start_column The start column. # @param total_rows The total rows # @param total_columns The total columns. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_worksheet_merge test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 start_row = 1 start_column = 1 total_rows = 2 total_columns = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_worksheet_merge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_post_worksheet_unmerge # Unmerge cells. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param start_row The start row. # @param start_column The start column. # @param total_rows The total rows # @param total_columns The total columns. # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_post_worksheet_unmerge test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 start_row = 1 start_column = 1 total_rows = 2 total_columns = 2 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_post_worksheet_unmerge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_put_insert_worksheet_columns # Insert worksheet columns. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param column_index The column index. # @param columns The columns. # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :update_reference The update reference. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [ColumnsResponse] describe 'cells_put_insert_worksheet_columns test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 column_index = 100 columns = 2 update_reference = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_put_insert_worksheet_columns(name, sheet_name, column_index, columns, {:update_reference=>update_reference, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_put_insert_worksheet_row # Insert new worksheet row. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param row_index The new row index. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [RowResponse] describe 'cells_put_insert_worksheet_row test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 row_index = 100 folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_put_insert_worksheet_row(name, sheet_name, row_index, { :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_put_insert_worksheet_rows # Insert several new worksheet rows. # # @param name The workbook name. # @param sheet_name The worksheet name. # @param startrow The begin row index to be operated. # @param [Hash] opts the optional parameters # @option opts [Integer] :total_rows Number of rows to be operated. # @option opts [BOOLEAN] :update_reference Indicates if update references in other worksheets. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_put_insert_worksheet_rows test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 startrow = 1 total_rows = 2 update_reference = true folder = $TEMPFOLDER storage = nil result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_put_insert_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end