var helper = require("../../helper");
var Manager = require("../../../src/etl/dim-category-etl-manager");
var instanceManager = null;
var should = require("should");
var sqlHelper = require("../../sql-helper");

before("#00. connect db", function (done) {
    Promise.all([helper, sqlHelper])
    .then((result) => {
        var db = result[0];
        var sql = result[1];
        db.getDb().then((db) => {
            instanceManager = new Manager(db, {
                username: "unit-test"
            }, sql);
            done();
        })
        .catch((e) => {
            done(e);
        })
    });
});

it("#01. should success when create etl for dim-category", function(done) {
    instanceManager.run()
        .then(() => {
            done();
        })
        .catch((e) => {
            done(e);
        });
});

it("#02. should success when transforming data for dim-category", function(done) {
    var data = [{}, {}];
    instanceManager.transform(data)
        .then(() => {
            done();
        })
        .catch((e) => {
            done(e);
        });
});

it("#03. should success when load data for dim-category", function(done) {
    var data = [[], []];
    instanceManager.load(data)
        .then(() => {
            done();
        })
        .catch((e) => {
            done(e);
        });
});
@@ -1080,24 +1080,27 @@
    %7D);%0A%7D);%0A%0A
+// 
 it(%22#03. sho
@@ -1154,32 +1154,35 @@
 unction(done) %7B%0A
+// 
     var data = %5B
@@ -1190,20 +1190,23 @@
 %5D, %5B%5D%5D;%0A
+//
     
+ 
 instance
@@ -1220,24 +1220,27 @@
 .load(data)%0A
+// 
         .the
@@ -1241,32 +1241,35 @@
   .then(() =%3E %7B%0A
+// 
             done
@@ -1264,32 +1264,35 @@
         done();%0A
+// 
         %7D)%0A     
@@ -1278,32 +1278,35 @@
 ;%0A//         %7D)%0A
+// 
         .catch((
@@ -1305,32 +1305,34 @@
 .catch((e) =%3E %7B%0A
+//
             done
@@ -1319,32 +1319,33 @@
 %7B%0A//            
+ 
 done(e);%0A       
@@ -1329,31 +1329,34 @@
        done(e);%0A
+// 
         %7D);%0A%7D);
@@ -1340,23 +1340,26 @@
 (e);%0A//         %7D);%0A
+// 
 %7D);

update unit test