module.exports = function (test, sandal) {

	test('Register some components', function (t) {
		sandal
			.object('a', { data: 'data' })
			.factory('b', function (a) { return 'b' + a.data; })
			.factory('err', function(done) { done(new Error('Some error')); })
			.object('c', 'c object');
		t.end();
	});

	test('Resolve one with promise', function (t) {
		sandal.promise('c').then(function (c) {
			t.equal(c, 'c object', 'should get the dependency');
			t.end();
		});
	});

	test('Resolve many with promise', function (t) {
		sandal.promise('c', 'b').then(function (result) {
			var expected = [
				'c object',
				'bdata'
			];
			t.deepEqual(result, expected, 'should get all dependencies as object');
			t.end();
		});
	});

	test('Resolve many with promise and spread', function (t) {
		sandal.promise('c', 'b').spread(function (c, b) {
			t.equal(c, 'c object', 'should spread results');
			t.equal(b, 'bdata', 'should spread results');
			t.end();
		});
	});

	test('Promise one with error', function (t) {
		t.plan(1);
		sandal.promise('err').then(
			function () {
				t.fail('Should not resolve');
			},
			function (err) {
				t.equal(err.message, 'Some error', 'should reject the promise');
			});
	});

	test('Promise many with error', function (t) {
		t.plan(1);
		sandal.promise('a', 'err').then(
			function () {
				t.fail('Should not resolve');
			},
			function (err) {
				t.equal(err.message, 'Some error', 'should reject the promise');
			});
	});

	test('Promise one non existing', function (t) {
		t.plan(1);
		sandal.promise('d').then(
			function () {
				t.fail('Should not resolve');
			},
			function (err) {
				t.ok(err, 'should reject the promise');
			});
	});

	test('Promise one of many non existing', function (t) {
		t.plan(1);
		sandal.promise('a', 'd').then(
			function () {
				t.fail('Should not resolve');
			},
			function (err) {
				t.ok(err, 'should reject the promise');
			});
	});

};
@@ -78,32 +78,51 @@
  function (t) %7B%0A
+%09%09var counter = 0;%0A
 %09%09sandal%0A%09%09%09.obj
@@ -114,16 +114,16 @@
 %09sandal%0A
-
 %09%09%09.obje
@@ -297,24 +297,96 @@
  'c object')
+%0A%09%09%09.factory('trans', function () %7B return 'trans' + counter++; %7D, true)
 ;%0A%09%09t.end();
@@ -701,16 +701,16 @@
 bject',%0A
-
 %09%09%09%09'bda
@@ -810,32 +810,328 @@
 ();%0A%09%09%7D);%0A%09%7D);%0A%0A
+%09test('Resolve many with duplicates with promise', function (t) %7B%0A%09%09sandal.promise('trans', 'b', 'trans').then(function (result) %7B%0A%09%09%09var expected = %5B%0A%09%09%09%09'trans0',%0A%09%09%09%09'bdata',%0A%09%09%09%09'trans1'%0A%09%09%09%5D;%0A%09%09%09t.deepEqual(result, expected, 'should get all dependencies as object');%0A%09%09%09t.end();%0A%09%09%7D);%0A%09%7D);%0A%0A
 %09test('Resolve m

Test for multiple transient factories