Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added tests for getTaxProfile #58

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions spec/api/settings_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
@modify_vat_type_response_obj = { "data": { "id": 0, "value": 22, "description": "Non imponibile art. 123", "notes": "IVA non imponibile ai sensi dell'articolo 123, comma 2", "e_invoice": true, "ei_type": 2, "ei_description": "string", "editable": true, "is_disabled": true } }
allow(@api_instance).to receive(:modify_vat_type) { @modify_vat_type_response_obj }

@get_tax_profile_response_obj = { "data": { "company_type": "individual", "company_subtype": "artigiani", "profession": "test", "regime": "forfettario_5", "rivalsa_name": "", "default_rivalsa": 0, "cassa_name": "", "default_cassa": 0, "default_cassa_taxable": 100, "cassa2_name": "", "default_cassa2": 0, "default_cassa2_taxable": 0, "default_withholding_tax": 0, "default_withholding_tax_taxable": 100, "default_other_withholding_tax": 0, "enasarco": false, "enasarco_type": "test", "contributions_percentage": 0, "med": false, "default_vat": { "id": 66, "value": 0, "description": "Contribuenti forfettari", "notes": "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190/2014 e succ. modifiche/integrazioni", "e_invoice": true, "ei_type": 2.2, "ei_description": "Non soggetta art. 1/54-89 L. 190/2014 e succ. modifiche/integrazioni", "editable": false, "is_disabled": false, "default": true } } }
allow(@api_instance).to receive(:get_tax_profile) { @get_tax_profile_response_obj }

end

after do
Expand Down Expand Up @@ -274,4 +277,21 @@
end
end

# unit tests for get_tax_profile
# Get Tax Profile
# Gets the tax profile of the specified company.
# @param company_id The ID of the company.
# @param [Hash] opts the optional parameters
# @return [GetTaxProfileResponse]
describe 'get_tax_profile test' do
it 'should work' do
response = @api_instance.get_tax_profile(2)
response_obj = JSON.parse(response.to_json, object_class: OpenStruct)
expected_json = @get_tax_profile_response_obj.to_json
actual_json = response.to_json

expect(actual_json).to eq(expected_json)
end
end

end
40 changes: 36 additions & 4 deletions spec/models/get_tax_profile_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,50 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe FattureInCloud_Ruby_Sdk::GetTaxProfileResponse do
let(:instance) { FattureInCloud_Ruby_Sdk::GetTaxProfileResponse.new }
instance = FattureInCloud_Ruby_Sdk::GetTaxProfileResponse.new
instance.data = {
company_type: "individual",
company_subtype: "artigiani",
profession: "test",
regime: "forfettario_5",
rivalsa_name: "",
default_rivalsa: 0,
cassa_name: "",
default_cassa: 0,
default_cassa_taxable: 100,
cassa2_name: "",
default_cassa2: 0,
default_cassa2_taxable: 0,
default_withholding_tax: 0,
default_withholding_tax_taxable: 100,
default_other_withholding_tax: 0,
enasarco: false,
enasarco_type: "test",
contributions_percentage: 0,
med: false,
default_vat: {
id: 66,
value: 0,
description: "Contribuenti forfettari",
notes: "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni",
e_invoice: true,
ei_type: 2.2,
ei_description: "Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni",
editable: false,
is_disabled: false,
default: true
}
}

describe 'test an instance of GetTaxProfileResponse' do
it 'should create an instance of GetTaxProfileResponse' do
# uncomment below to test the instance creation
# expect(instance).to be_instance_of(FattureInCloud_Ruby_Sdk::GetTaxProfileResponse)
expect(instance).to be_instance_of(FattureInCloud_Ruby_Sdk::GetTaxProfileResponse)
end
end

describe 'test attribute "data"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.data).to be_a_kind_of(Object)
end
end

Expand Down
102 changes: 75 additions & 27 deletions spec/models/tax_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,138 +18,186 @@
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe FattureInCloud_Ruby_Sdk::TaxProfile do
let(:instance) { FattureInCloud_Ruby_Sdk::TaxProfile.new }
instance = FattureInCloud_Ruby_Sdk::TaxProfile.new
instance.company_type = "individual"
instance.company_subtype = "artigiani"
instance.profession = "test"
instance.regime = "forfettario_5"
instance.rivalsa_name = ""
instance.default_rivalsa = 0
instance.cassa_name = ""
instance.default_cassa = 0
instance.default_cassa_taxable = 100
instance.cassa2_name = ""
instance.default_cassa2 = 0
instance.default_cassa2_taxable = 0
instance.default_withholding_tax = 0
instance.default_withholding_tax_taxable = 100
instance.default_other_withholding_tax = 0
instance.enasarco = false
instance.enasarco_type = "test"
instance.contributions_percentage = 0
instance.med = false
instance.default_vat = {
id: 66,
value: 0,
description: "Contribuenti forfettari",
notes: "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni",
e_invoice: true,
ei_type: 2.2,
ei_description: "Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni",
editable: false,
is_disabled: false,
default: true
}

describe 'test an instance of TaxProfile' do
it 'should create an instance of TaxProfile' do
# uncomment below to test the instance creation
# expect(instance).to be_instance_of(FattureInCloud_Ruby_Sdk::TaxProfile)
expect(instance).to be_instance_of(FattureInCloud_Ruby_Sdk::TaxProfile)
end
end

describe 'test attribute "company_type"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.company_type).to be_instance_of(String)
end
end

describe 'test attribute "company_subtype"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.company_subtype).to be_instance_of(String)
end
end

describe 'test attribute "profession"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.profession).to be_instance_of(String)
end
end

describe 'test attribute "regime"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.regime).to be_instance_of(String)
end
end

describe 'test attribute "rivalsa_name"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.rivalsa_name).to be_instance_of(String)
end
end

describe 'test attribute "default_rivalsa"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_rivalsa).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "cassa_name"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.cassa_name).to be_instance_of(String)
end
end

describe 'test attribute "default_cassa"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_cassa).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_cassa_taxable"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_cassa_taxable).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "cassa2_name"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.cassa2_name).to be_instance_of(String)
end
end

describe 'test attribute "default_cassa2"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_cassa2).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_cassa2_taxable"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_cassa2_taxable).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_withholding_tax"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_withholding_tax).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_withholding_tax_taxable"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_withholding_tax_taxable).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_other_withholding_tax"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_other_withholding_tax).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "enasarco"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.enasarco).to be(true).or be(false)
end
end

describe 'test attribute "enasarco_type"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.enasarco_type).to be_instance_of(String)
end
end

describe 'test attribute "contributions_percentage"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.contributions_percentage).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "profit_coefficient"' do
describe 'test attribute "med"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.med).to be(true).or be(false)
end
end

describe 'test attribute "med"' do
describe 'test attribute "default_vat"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_vat).to be_a_kind_of(Hash)
end
end

describe 'test attribute "default_vat"' do
describe 'test attribute "default_vat.id"' do
it 'should work' do
expect(instance.default_vat[:id]).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_vat.value"' do
it 'should work' do
expect(instance.default_vat[:value]).to be_a_kind_of(Numeric)
end
end

describe 'test attribute "default_vat.description"' do
it 'should work' do
expect(instance.default_vat[:description]).to be_instance_of(String)
end
end

describe 'test attribute "default_vat.notes"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
expect(instance.default_vat[:notes]).to be_instance_of(String)
end
end

Expand Down