/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    mockInjector = require('../../../mock_injector'),
    pixabayApiFetch = require('../../../../lib/fetch/pixabay_api_fetch.js');

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

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

exports['Validate query data.'] = function (test) {
    pixabayApiFetch({
        key: 'key0',
        username: null
    }, function (err) {
        test.ok(err);
        pixabayApiFetch({
            key: null,
            username: 'foo'
        }, function (err) {
            test.ok(err);
            test.done();
        });
    });
};
//
//exports['Pixabay api fetch.'] = function (test) {
//    mockInjector.inject(pixabayApiFetch, '_getJSON', function (u, callback) {
//        callback(null, {});
//    });
//    try {
//        var secret = require('../../../../settings/secrets/pixabay-secret');
//    } catch (e) {
//        //If the secret not founds, just finish test.
//        test.done();
//        return;
//    }
//    pixabayApiFetch({
//        username: secret.username,
//        key: secret.key
//    }, function (err, data) {
//        mockInjector.restore();
//        test.ifError(err);
//        test.done();
//
//    });
//};