Completed
Push — master ( 12c703...196755 )
by Justin
02:02
created

test/rs/PlaceDescription.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 34
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 34
rs 10
wmc 5
mnd 0
bc 5
fnc 5
bpm 1
cpm 1
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
B PlaceDescription.js ➔ describe(ꞌPlaceDescriptionꞌ) 0 24 1
A PlaceDescription.js ➔ test 0 6 1
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
}