Total Complexity | 5 |
Complexity/F | 1 |
Lines of Code | 34 |
Function Count | 5 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | var assert = require('chai').assert, |
||
2 | GedcomX = require('../../'); |
||
3 | |||
4 | describe('PlaceDescription', function(){ |
||
5 | |||
6 | var json = { |
||
7 | display: { |
||
8 | name: 'place name', |
||
9 | fullName: 'place name, in a place', |
||
10 | type: 'place type' |
||
11 | } |
||
12 | }; |
||
13 | |||
14 | it('Create with JSON', function(){ |
||
15 | test(GedcomX.PlaceDescription(json)); |
||
16 | }); |
||
17 | |||
18 | it('Build', function(){ |
||
19 | test(GedcomX.PlaceDescription() |
||
20 | .setDisplay(json.display)); |
||
21 | }); |
||
22 | |||
23 | it('toJSON', function(){ |
||
24 | assert.deepEqual(GedcomX.PlaceDescription(json).toJSON(), json); |
||
25 | }); |
||
26 | |||
27 | }); |
||
28 | |||
29 | function test(description){ |
||
30 | var display = description.getDisplay(); |
||
31 | assert.equal(display.getName(), 'place name'); |
||
32 | assert.equal(display.getFullName(), 'place name, in a place'); |
||
33 | assert.equal(display.getType(), 'place type'); |
||
34 | } |