"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _option = _interopRequireDefault(require("../../lib/data/option"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/*
  ======== A Handy Little Nodeunit Reference ========
  https://github.com/caolan/nodeunit

  Test methods:
    test.expect(numAssertions)
    test.done()
  Test assertions:
    test.ok(value, [message])
    test.equal(actual, expected, [message])
    test.notEqual(actual, expected, [message])
    test.deepEqual(actual, expected, [message])
    test.notDeepEqual(actual, expected, [message])
    test.strictEqual(actual, expected, [message])
    test.notStrictEqual(actual, expected, [message])
    test.throws(block, [error], [message])
    test.doesNotThrow(block, [error], [message])
    test.ifError(value)
*/
var _default = exports["default"] = {
  setUp: function setUp(done) {
    done();
  },
  'option empty': function option_empty(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].none().isPresent(), false, 'should be empty option.');
    test.done();
  },
  'option not empty': function option_not_empty(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).isPresent(), true, 'should not be empty option.');
    test.done();
  },
  'option empty mapped': function option_empty_mapped(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].none().map(function (a) {
      return a;
    }).isPresent(), false, 'should be empty option.');
    test.done();
  },
  'option not empty mapped': function option_not_empty_mapped(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).map(function (a) {
      return a;
    }).get(), 12, 'should not be empty option.');
    test.done();
  },
  'option not empty flat mapped to option': function option_not_empty_flat_mapped_to_option(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).flatMap(function (a) {
      return _option["default"].some(a);
    }).get(), 12, 'should not be empty option.');
    test.done();
  },
  'option empty flat mapped': function option_empty_flat_mapped(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].none().flatMap(function (a) {
      return a;
    }).isPresent(), false, 'should be empty option.');
    test.done();
  },
  'option empty or else': function option_empty_or_else(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].none().orElse(12), 12, 'should be empty option.');
    test.done();
  },
  'option not empty or else': function option_not_empty_or_else(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).orElse(14), 12, 'should be not empty option.');
    test.done();
  },
  'option empty or lazy else': function option_empty_or_lazy_else(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].none().orLazyElse(function () {
      return 12;
    }), 12, 'should be empty option.');
    test.done();
  },
  'option not empty or lazy else': function option_not_empty_or_lazy_else(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).orLazyElse(function () {
      return 14;
    }), 12, 'should be not empty option.');
    test.done();
  },
  'option empty filter': function option_empty_filter(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].none().filter(function (v) {
      return v === 1;
    }).isPresent(), false, 'should be empty option.');
    test.done();
  },
  'option not empty filter': function option_not_empty_filter(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).filter(function (v) {
      return v === 12;
    }).get(), 12, 'should be not empty option.');
    test.done();
  },
  'option not empty wrong filter': function option_not_empty_wrong_filter(test) {
    test.expect(1);
    // tests here
    test.equal(_option["default"].some(12).filter(function (v) {
      return v === 13;
    }).isPresent(), false, 'should be empty option.');
    test.done();
  }
};
//# sourceMappingURL=option_test.js.map