var random = require('./index.js');
var assert = require("assert");

describe('Test generation 1d array', function(){
    it('should return 2', function(){
        assert.deepEqual(random(2,2).oned(1, {round:true}), [2]);
    }),

    it('should return random array of numbers between [0,10] of length 100', function(){
        var result = random(0,10).oned(100);
        assert.equal(result.length,100);
        assert.equal(result.filter(function(x){ if (x < 0 || x > 10) return x;}).length,0);

    })
    
});

describe('Test generation 2d array', function(){
   it('should return random 2d array of dimension 3x2', function(){
       var result = random(0,10).twod(3,2);
       assert.equal(result.length,3);
       assert.equal(result[0].length,2);
   })
});

@@ -755,12 +755,646 @@
 ;%0A   %7D)%0A%7D);%0A
+%0A%0Adescribe('Test generation while not found target value', function()%7B%0A    it('should return 10000 values', function()%7B%0A        var result = random(0,10).genWhile(function(i)%7B return i === 11;%7D);%0A        assert.equal(result.length,10000);%0A    %7D);%0A%0A    it('should return 25 values', function()%7B%0A         var result = random(0,10).genWhile(function(i)%7B return i === 11;%7D, %7Blimit: 25%7D);%0A         assert.equal(result.length, 25);%0A    %7D);%0A%0A    it('should return value greater then 0', function()%7B%0A        var result = random(0,10).genWhile(function(i)%7B return Math.round(i) === 5;%7D);%0A        assert.notEqual(result.length,0);%0A    %7D);%0A%0A%7D);%0A

add tests for genWhile