/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    mockInjector = require('../../../mock_injector'),
    FormattableDate = require('../../../../lib/date/formattable_date.js');

exports.setUp = function (done) {
    done();
};

exports.tearDown = function (done) {
    mockInjector.restoreAll();
    done();
};


exports['Formattable date.'] = function (test) {
    var date = new FormattableDate('2012/12/12');
    test.equal(date.getFullYear(), 2012);
    test.done();
};
exports['Add date.'] = function (test) {
    var date = new FormattableDate('2012/3/8');
    date.addDate(4);
    test.equal(date.getDate(), 12);
    test.done();
};
exports['Add month.'] = function (test) {
    var date = new FormattableDate('2012/3/8');
    date.addMonth(4);
    test.equal(date.getMonth(), 6);
    test.done();
};
exports['Add year.'] = function (test) {
    var date = new FormattableDate('2012/3/8');
    date.addYear(4);
    test.equal(date.getFullYear(), 2016);
    test.done();
};
exports['Format date.'] = function (test) {
    var date = new FormattableDate('2012/3/8');
    test.equal(date.format('yyyy-mm-dd'), '2012-03-08');
    test.done();
};