require 'spec_helper' require 'json' # Unit tests for AsposeCellsCloud::CellsHypelinksApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate describe 'CellsHypelinksApi' 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_hypelinks_get_worksheet_hyperlink # Get worksheet hyperlink by index. # # @param name Document name. # @param sheet_name Worksheet name. # @param hyperlink_index The hyperlink's index. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [HyperlinkResponse] describe 'cells_hypelinks_get_worksheet_hyperlink test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 hyperlink_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_hypelinks_get_worksheet_hyperlink(name, sheet_name, hyperlink_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_hypelinks_get_worksheet_hyperlinks # Get worksheet hyperlinks. # # @param name Document name. # @param sheet_name The worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :folder Document's folder. # @option opts [String] :storage storage name. # @return [HyperlinksResponse] describe 'cells_hypelinks_get_worksheet_hyperlinks 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_hypelinks_get_worksheet_hyperlinks(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_hypelinks_post_worksheet_hyperlink # Update worksheet hyperlink by index. # # @param name Document name. # @param sheet_name Worksheet name. # @param hyperlink_index The hyperlink's index. # @param [Hash] opts the optional parameters # @option opts [Hyperlink] :hyperlink Hyperlink object # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [HyperlinkResponse] describe 'cells_hypelinks_post_worksheet_hyperlink test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 hyperlink_index = 0 hyperlink = AsposeCellsCloud::Hyperlink.new({:Address=>'www.aspose.com'}) 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_hypelinks_post_worksheet_hyperlink(name, sheet_name, hyperlink_index, { :hyperlink=>hyperlink, :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_hypelinks_put_worksheet_hyperlink # Add worksheet hyperlink. # # @param name Document name. # @param sheet_name Worksheet name. # @param first_row # @param first_column # @param total_rows # @param total_columns # @param address # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [HyperlinkResponse] describe 'cells_hypelinks_put_worksheet_hyperlink test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 first_row = 1 first_column = 1 total_rows = 2 total_columns = 2 address = 'www.aspose.com' 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_hypelinks_put_worksheet_hyperlink(name, sheet_name, first_row, first_column, total_rows, total_columns, address, { :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_hypelinks_delete_worksheet_hyperlink # Delete worksheet hyperlink by index. # # @param name Document name. # @param sheet_name Worksheet name. # @param hyperlink_index The hyperlink's index. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_hypelinks_delete_worksheet_hyperlink test' do it "should work" do name = $BOOK1 sheet_name = $SHEET1 hyperlink_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_hypelinks_delete_worksheet_hyperlink(name, sheet_name, hyperlink_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_hypelinks_delete_worksheet_hyperlinks # Delete all hyperlinks in worksheet. # # @param name Document name. # @param sheet_name Worksheet name. # @param [Hash] opts the optional parameters # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_hypelinks_delete_worksheet_hyperlinks 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_hypelinks_delete_worksheet_hyperlinks(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