=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::CellsTaskApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate describe 'CellsTaskApi' do before do # run before each test if $access_token == nil then conf = AsposeCellsCloud::Configuration.new conf.base_path = "" instance = AsposeCellsCloud::OAuthApi.new(AsposeCellsCloud::ApiClient.new(conf)) $access_token = instance.o_auth_post($grant_type,$client_id,$client_secret).access_token end conf = AsposeCellsCloud::Configuration.new conf.access_token = $access_token client = AsposeCellsCloud::ApiClient.new(conf) client.default_headers["Authorization"] ="Bearer " + $access_token @instance = AsposeCellsCloud::CellsTaskApi.new(client) end after do # run after each test end describe 'test an instance of CellsTaskApi' do it 'should create an instance of CellsTaskApi' do expect(@instance).to be_instance_of(AsposeCellsCloud::CellsTaskApi) end end # unit tests for cells_task_post_run_task # Run tasks # # @param task_data # @param [Hash] opts the optional parameters # @return [Object] describe 'cells_task_post_run_task test' do it "should work" do # TaskData taskData = new TaskData(); # List tasks = new ArrayList(); # TaskDescription task1 = new TaskDescription(); # task1.setTaskType ("SplitWorkbook"); # # SplitWorkbookTaskParameter param1 = new SplitWorkbookTaskParameter(); # param1.setDestinationFileFormat ( "xlsx"); # # FileSource fs = new FileSource(); # fs.setFilePath( TEMPFOLDER); # fs.setFileSourceType ( "CloudFileSystem"); # param1.setDestinationFilePosition (fs); # param1.setSplitNameRule ( "sheetname"); # FileSource ds = new FileSource(); # ds.setFilePath( TEMPFOLDER + "\\" + BOOK1); # ds.setFileSourceType ( "CloudFileSystem"); # param1.setWorkbook (ds); # # task1.setTaskParameter ( param1); # tasks.add(task1); # taskData.setTasks(tasks); # taskData.getTasks().add(task1); param1 = AsposeCellsCloud::SplitWorkbookTaskParameter.new({:DestinationFileFormat=>'xlsx' ,:DestinationFilePosition=> AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER,:FileSourceType=>'CloudFileSystem'}),:SplitNameRule=>'sheetname',:Workbook=>AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER +'\\' + $BOOK1,:FileSourceType=>'CloudFileSystem'})}) task1 =AsposeCellsCloud::TaskDescription.new({:TaskType=>'SplitWorkbook',:TaskParameter=>param1}) task_data = AsposeCellsCloud::TaskData.new(:Tasks=>[task1]) @instance.cells_task_post_run_task(task_data) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end