/**
 * @file The main entry point for the OpenAddresses importer's unit-tests.
 */

'use strict';

var tape = require( 'tape' );
var createAdminValues = require( '../lib/create_admin_values' );

tape( 'createAdminValues.getCoverageObject(): ', function ( test ){
  var testCases = [
    [ 'a-b-c', [ 'a', 'b', 'c' ] ],
    [ 'a-b-c_d', [ 'a', 'b', 'c d' ] ]
  ];

  test.plan( testCases.length );
  for( var ind = 0; ind < testCases.length; ind++ ){
    var actual = createAdminValues.getCoverageObject(
      testCases[ ind ][ 0 ], '/dev/null'
    );
    test.deepEqual( actual, {
      country: testCases[ ind ][ 1 ][ 0 ],
      state: testCases[ ind ][ 1 ][ 1 ],
      city: testCases[ ind ][ 1 ][ 2 ]
    });
  }
});

@@ -710,12 +710,701 @@
 %7D);%0A  %7D%0A%7D);%0A
+%0Atape( 'createAdminValues.create(): ', function ( test )%7B%0A  var testCases = %5B%0A    %5B 'us-ny-ab', %5B 'United States', 'New York', 'AB' %5D %5D,%0A    %5B 'cA-On-abc_def', %5B 'Canada', 'Ontario', 'Abc Def' %5D %5D,%0A    %5B 'US-ZT-a_small_town', %5B 'United States', 'ZT', 'A Small Town' %5D %5D,%0A    %5B 'ZZ-aa-a_small_town', %5B 'ZZ', 'AA', 'A Small Town' %5D %5D%0A  %5D;%0A%0A  test.plan( testCases.length );%0A  for( var ind = 0; ind %3C testCases.length; ind++ )%7B%0A    var actual = createAdminValues.create(%0A      testCases%5B ind %5D%5B 0 %5D, '/dev/null'%0A    );%0A    test.deepEqual( actual, %7B%0A      country: testCases%5B ind %5D%5B 1 %5D%5B 0 %5D,%0A      region: testCases%5B ind %5D%5B 1 %5D%5B 1 %5D,%0A      locality: testCases%5B ind %5D%5B 1 %5D%5B 2 %5D%0A    %7D);%0A  %7D%0A%7D);%0A

Resolve #4: add a unit test for create().