it('should deserialize all fields', () => { expect(DatePaid.fromObject({ date: { year: 2017, month: 12, day: 31 } })).to.deep.equal(datePaid(2017, 12, 31)) })
it('should reject non existing date', () => { const errors = validator.validateSync(datePaid(2017, 2, 29)) expect(DatePaid.fromObject(null)).to.be.equal(null) expectValidationError(errors, ValidationErrors.DATE_NOT_VALID) })
it('should return null when value is null', () => { expect(DatePaid.fromObject(null)).to.be.equal(null) })
it('should return undefined when value is undefined', () => { expect(DatePaid.fromObject(undefined)).to.be.undefined })