require 'spec_helper' require 'json' # Unit tests for AsposeCellsCloud::CellsConditionalFormattingsApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate describe 'CellsConditionalFormattingsApi' 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_conditional_formattings_get_worksheet_conditional_formatting # Get conditional formatting # # @param name # @param sheet_name # @param index # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [ConditionalFormattingResponse] describe 'cells_conditional_formattings_get_worksheet_conditional_formatting test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER 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_conditional_formattings_get_worksheet_conditional_formatting(name, sheet_name, 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_conditional_formattings_get_worksheet_conditional_formattings # Get conditional formattings # # @param name # @param sheet_name # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [ConditionalFormattingsResponse] describe 'cells_conditional_formattings_get_worksheet_conditional_formattings test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER 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_conditional_formattings_get_worksheet_conditional_formattings(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_conditional_formattings_put_worksheet_conditional_formatting # Add a condition formatting. # # @param name # @param sheet_name # @param cell_area # @param [Hash] opts the optional parameters # @option opts [FormatCondition] :formatcondition # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_put_worksheet_conditional_formatting test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 cell_area = $CELLAREA formatcondition = AsposeCellsCloud::FormatCondition.new({:'Type'=> 'CellValue', :'Operator'=>'Between',:'Formula1'=>'v1',:'Formula2'=>'v1'}) folder = $TEMPFOLDER 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_conditional_formattings_put_worksheet_conditional_formatting(name, sheet_name, cell_area, {:format_condition=>formatcondition, :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_conditional_formattings_put_worksheet_format_condition # Add a format condition. # # @param name # @param sheet_name # @param index # @param cell_area # @param type # @param operator_type # @param formula1 # @param formula2 # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_put_worksheet_format_condition test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 index = 0 cell_area = $CELLAREA type = 'CellValue' operator_type = 'Between' formula1 = 'v1' formula2 = 'v2' folder = $TEMPFOLDER 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_conditional_formattings_put_worksheet_format_condition(name, sheet_name, index, cell_area, type, operator_type, formula1, formula2, { :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_conditional_formattings_put_worksheet_format_condition_area # add a cell area for format condition # # @param name # @param sheet_name # @param index # @param cell_area # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_put_worksheet_format_condition_area test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 index = 0 cell_area = $CELLAREA folder = $TEMPFOLDER 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_conditional_formattings_put_worksheet_format_condition_area(name, sheet_name, index, cell_area, { :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_conditional_formattings_put_worksheet_format_condition_condition # Add a condition for format condition. # # @param name # @param sheet_name # @param index # @param type # @param operator_type # @param formula1 # @param formula2 # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_put_worksheet_format_condition_condition test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 index = 0 type = 'CellValue' operator_type = 'Between' formula1 = 'v1' formula2 = 'v2' folder = $TEMPFOLDER 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_conditional_formattings_put_worksheet_format_condition_condition(name, sheet_name, index, type, operator_type, formula1, formula2, { :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_conditional_formattings_delete_worksheet_conditional_formatting # Remove conditional formatting # # @param name # @param sheet_name # @param index # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_delete_worksheet_conditional_formatting test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 index = 0 folder = $TEMPFOLDER 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_conditional_formattings_delete_worksheet_conditional_formatting(name, sheet_name, 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_conditional_formattings_delete_worksheet_conditional_formatting_area # Remove cell area from conditional formatting. # # @param name # @param sheet_name # @param start_row # @param start_column # @param total_rows # @param total_columns # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_delete_worksheet_conditional_formatting_area test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 start_row = 1 start_column = 1 total_rows = 4 total_columns = 6 folder = $TEMPFOLDER 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_conditional_formattings_delete_worksheet_conditional_formatting_area(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_conditional_formattings_delete_worksheet_conditional_formattings # Clear all condition formattings # # @param name # @param sheet_name # @param [Hash] opts the optional parameters # @option opts [String] :folder # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_conditional_formattings_delete_worksheet_conditional_formattings test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 folder = $TEMPFOLDER 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_conditional_formattings_delete_worksheet_conditional_formattings(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 end