=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::CellsPicturesApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate describe 'CellsPicturesApi' do before do @instance = AsposeCellsCloud::CellsApi.new("66164C51-693E-4904-A121-545961673EC1","536e76768419db9585afdd37bb5f7533") end after do # run after each test end # unit tests for cells_pictures_get_worksheet_picture # GRead worksheet picture by number. # # @param name Document name. # @param sheet_name Worksheet name. # @param picture_index The picture index. # @param [Hash] opts the optional parameters # @option opts [String] :format The exported object format. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [File] describe 'cells_pictures_get_worksheet_picture test' do it "should work" do name = $BOOK1 sheet_name = $SHEET6 picture_index = 0 format = 'PNG' folder = $TEMPFOLDER @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) @instance.cells_pictures_get_worksheet_picture(name, sheet_name, picture_index, {:format=>format, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_pictures_get_worksheet_pictures # Read worksheet pictures. # # @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 [PicturesResponse] describe 'cells_pictures_get_worksheet_pictures test' do it "should work" do name = $BOOK1 sheet_name = $SHEET6 folder = $TEMPFOLDER @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) @instance.cells_pictures_get_worksheet_pictures(name, sheet_name, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_pictures_post_worksheet_picture # Update worksheet picture by index. # # @param name Document name. # @param sheet_name Worksheet name. # @param picture_index The picture's index. # @param [Hash] opts the optional parameters # @option opts [Picture] :picture Picture object # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [PictureResponse] describe 'cells_pictures_post_worksheet_picture test' do it "should work" do name = $BOOK1 sheet_name = $SHEET6 picture_index = 0 picture = AsposeCellsCloud::Picture.new(:AlternativeText=>'AlternativeText') folder = $TEMPFOLDER @instance.cells_pictures_post_worksheet_picture(name, sheet_name, picture_index, {:picture=>picture, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_pictures_put_worksheet_add_picture # Add a new worksheet picture. # # @param name The workbook name. # @param sheet_name The worsheet name. # @param [Hash] opts the optional parameters # @option opts [Picture] :picture Pictute object # @option opts [Integer] :upper_left_row The image upper left row. # @option opts [Integer] :upper_left_column The image upper left column. # @option opts [Integer] :lower_right_row The image low right row. # @option opts [Integer] :lower_right_column The image low right column. # @option opts [String] :picture_path The picture path, if not provided the picture data is inspected in the request body. # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [PicturesResponse] describe 'cells_pictures_put_worksheet_add_picture test' do it "should work" do name = $BOOK1 sheet_name = $SHEET6 picture = nil upper_left_row = 1 upper_left_column = 1 lower_right_row = 10 lower_right_column = 10 picture_path = 'WaterMark.png' folder = $TEMPFOLDER @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) @instance.cells_pictures_put_worksheet_add_picture(name, sheet_name, {:picture=>picture, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :picture_path=>picture_path, :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_pictures_delete_worksheet_picture # Delete a picture object in worksheet # # @param name The workbook name. # @param sheet_name The worsheet name. # @param picture_index Picture index # @param [Hash] opts the optional parameters # @option opts [String] :folder The workbook folder. # @option opts [String] :storage storage name. # @return [CellsCloudResponse] describe 'cells_pictures_delete_worksheet_picture test' do it "should work" do name = $BOOK1 sheet_name = $SHEET6 picture_index = 0 folder = $TEMPFOLDER @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) @instance.cells_pictures_delete_worksheet_picture(name, sheet_name, picture_index, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_pictures_delete_worksheet_pictures # Delete all pictures 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_pictures_delete_worksheet_pictures test' do it "should work" do name = $BOOK1 sheet_name = $SHEET6 folder = $TEMPFOLDER @instance.upload_file( folder+"/"+name, ::File.open("/home/roywang/asposecellscloudsdk/data/" +name,"r") {|io| io.read(io.size) }) @instance.cells_pictures_delete_worksheet_pictures(name, sheet_name, { :folder=>folder}) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end