=begin #Fatture in Cloud API v2 - API Reference #Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. The version of the OpenAPI document: 2.0.7 Contact: info@fattureincloud.it Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.3.0 =end require 'spec_helper' require 'json' # Unit tests for FattureInCloud_Ruby_Sdk::TaxesApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'TaxesApi' do before do # run before each test @api_instance = FattureInCloud_Ruby_Sdk::TaxesApi.new @create_f24_response_obj = {"data":{"amount":840.36,"description":"PAGAMENTO IVA 2021","due_date":"2021-12-31","status":"paid","payment_account":{"id":111},"attachment_token":"b19c01da9b1688fb73d0d9e8ad"}} allow(@api_instance).to receive(:create_f24) {@create_f24_response_obj} @get_f24_response_obj = {"data":{"id":12345,"amount":840.36,"description":"PAGAMENTO IVA 2021","due_date":"2021-12-31","status":"paid","payment_account":{"id":111,"name":"Indesa - carta conto"},"attachment_url":"b19c01da9b1688fb73d0d9e8adae89a8.pdf"}} allow(@api_instance).to receive(:get_f24) {@get_f24_response_obj} @list_f24_response_obj = {"current_page":1,"data":[{"id":12345,"amount":840.36,"description":"PAGAMENTO IVA 2021","due_date":"2021-12-31","status":"paid","payment_account":{"id":111,"name":"Indesa - carta conto"},"attachment_url":"b19c01da9b1688fb73d0d9e8adae89a8.pdf"},{"id":12346,"amount":810.62,"description":"PAGAMENTO IVA 2020","due_date":"2020-12-31","status":"paid","payment_account":{"id":111,"name":"Indesa - carta conto"},"attachment_url":"bb6df8490dad4770353b378ea926d8ba.pdf"}],"first_page_url":"page=1","from":1,"last_page":1,"last_page_url":"page=1","next_page_url":nil,"path":"taxes","per_page":50,"prev_page_url":nil,"to":2,"total":2,"aggregated_data":{"amount":"6438.96"}} allow(@api_instance).to receive(:list_f24) {@list_f24_response_obj} @modify_f24_response_obj = {"data":{"id":12345,"amount":840.36,"description":"PAGAMENTO IVA 2021","due_date":"2021-12-31","status":"paid","payment_account":{"id":111,"name":"Indesa - carta conto"},"attachment_url":"b19c01da9b1688fb73d0d9e8adae89a8.pdf"}} allow(@api_instance).to receive(:modify_f24) {@modify_f24_response_obj} @upload_f24_attachment_response_obj = {"data":{"attachment_token":"YmMyNWYxYzIwMTU3N2Y4ZGE3ZjZiMzg5OWY0ODNkZDQveXl5LmRvYw"}} allow(@api_instance).to receive(:upload_f24_attachment) {@upload_f24_attachment_response_obj} end after do # run after each test end describe 'test an instance of TaxesApi' do it 'should create an instance of TaxesApi' do expect(@api_instance).to be_instance_of(FattureInCloud_Ruby_Sdk::TaxesApi) end end # unit tests for create_f24 # Create F24 # Creates a new F24. # @param company_id The ID of the company. # @param [Hash] opts the optional parameters # @option opts [CreateF24Request] :create_f24_request The F24 to create # @return [CreateF24Response] describe 'create_f24 test' do it 'should work' do opts = {"data":{"amount":840.36,"description":"PAGAMENTO IVA 2021","due_date":"2021-12-31","status":"paid","payment_account":{"id":21,"name":"Indesa - carta conto"}}} response = @api_instance.create_f24(2, opts) response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_f24_response_obj.to_json actual_json = response.to_json expect(actual_json).to eq(expected_json) end end # unit tests for delete_f24 # Delete F24 # Removes the specified F24. # @param company_id The ID of the company. # @param document_id The ID of the document. # @param [Hash] opts the optional parameters # @return [nil] describe 'delete_f24 test' do it 'should work' do expect(true).to eq(true) end end # unit tests for delete_f24_attachment # Delete F24 Attachment # Removes the attachment of the specified F24. # @param company_id The ID of the company. # @param document_id The ID of the document. # @param [Hash] opts the optional parameters # @return [nil] describe 'delete_f24_attachment test' do it 'should work' do expect(true).to eq(true) end end # unit tests for get_f24 # Get F24 # Gets the specified F24. # @param company_id The ID of the company. # @param document_id The ID of the document. # @param [Hash] opts the optional parameters # @option opts [String] :fields List of comma-separated fields. # @option opts [String] :fieldset Name of the fieldset. # @return [GetF24Response] describe 'get_f24 test' do it 'should work' do response = @api_instance.get_f24(2, 22) response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_f24_response_obj.to_json actual_json = response.to_json expect(actual_json).to eq(expected_json) end end # unit tests for list_f24 # List F24 # Lists the F24s. # @param company_id The ID of the company. # @param [Hash] opts the optional parameters # @option opts [String] :fields List of comma-separated fields. # @option opts [String] :fieldset Name of the fieldset. # @option opts [String] :sort List of comma-separated fields for result sorting (minus for desc sorting). # @option opts [Integer] :page The page to retrieve. # @option opts [Integer] :per_page The size of the page. # @option opts [String] :query Query for filtering the results. # @return [ListF24Response] describe 'list_f24 test' do it 'should work' do response = @api_instance.list_f24(2) response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_f24_response_obj.to_json actual_json = response.to_json expect(actual_json).to eq(expected_json) end end # unit tests for modify_f24 # Modify F24 # Modifies the specified F24. # @param company_id The ID of the company. # @param document_id The ID of the document. # @param [Hash] opts the optional parameters # @option opts [ModifyF24Request] :modify_f24_request The F24 # @return [ModifyF24Response] describe 'modify_f24 test' do it 'should work' do opts = {"data":{"amount":840.36,"description":"PAGAMENTO IVA 2021","due_date":"2021-12-31","status":"paid","payment_account":{"id":21,"name":"Indesa - carta conto"}}} response = @api_instance.modify_f24(2, 22, opts) response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_f24_response_obj.to_json actual_json = response.to_json expect(actual_json).to eq(expected_json) end end # unit tests for upload_f24_attachment # Upload F24 Attachment # Uploads an attachment destined to a F24. The actual association between the document and the attachment must be implemented separately, using the returned token. # @param company_id The ID of the company. # @param [Hash] opts the optional parameters # @option opts [String] :filename Name of the file. # @option opts [File] :attachment Valid format: .png, .jpg, .gif, .pdf, .zip, .xls, .xlsx, .doc, .docx # @return [UploadF24AttachmentResponse] describe 'upload_f24_attachment test' do it 'should work' do response = @api_instance.upload_f24_attachment(2, {}) response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @upload_f24_attachment_response_obj.to_json actual_json = response.to_json expect(actual_json).to eq(expected_json) end end end