'use strict';

var should = require('should');
var validate = require('validate.js');
var fixtures = require('./fixtures');

var AfricasTalking, airtime;

describe('AIRTIME', function(){
   
    this.timeout(5000);

    before(function () {
        AfricasTalking = require('../lib')(fixtures.TEST_ACCOUNT);
        airtime = AfricasTalking.AIRTIME;
    });
    
    it('validates options', function(){
        
        var options = {};
        
        (function() {
            let p = airtime.send(options);
        }).should.throw();
        
        options.recipients = [];
        (function() {
            let p = airtime.send(options);
        }).should.throw();
        
        options.recipients.push(
            {phoneNumber: 'not phone', amount:'NaN'}
            );
        (function() {
            let p = airtime.send(options);
        }).should.throw();
        
        
    });
    
    it('sends airtime', function(done){
       
       var opts = {
           recipients: [
               {
                   phoneNumber: '254726166685',
                   amount: 10
               },
               {
                   phoneNumber: '254726166685',
                   amount: 10
               }
           ]
       };
       
       airtime.send(opts)
            .then(function(resp){
                resp.should.have.property('responses');
                done();
            })
            .catch(function(err){
                console.error(err);
                done();
            });
        
    });
   
    
});
@@ -889,43 +889,972 @@
     
-%0A    %7D);%0A    %0A    it('sends airtime
+options.recipients = %5B%0A            %7BphoneNumber: '0712345678', amount:9%7D%0A        %5D;%0A        (function() %7B%0A            let p = airtime.send(options);%0A        %7D).should.throw();%0A        %0A        options.recipients = %5B%0A            %7BphoneNumber: '0712345678', amount:10001%7D%0A        %5D;%0A        (function() %7B%0A            let p = airtime.send(options);%0A        %7D).should.throw();%0A        %0A        %0A    %7D);%0A    %0A    it('sends airtime to one', function (done) %7B%0A        var opts = %7B%0A           recipients: %5B%0A               %7B%0A                   phoneNumber: '254726166685',%0A                   amount: 10%0A               %7D%0A           %5D%0A        %7D;%0A       %0A        airtime.send(opts)%0A            .then(function(resp)%7B%0A                resp.should.have.property('responses');%0A                done();%0A            %7D)%0A            .catch(function(err)%7B%0A                console.error(err);%0A                done();%0A            %7D);%0A            %0A    %7D);%0A    %0A    it('sends airtime to many
 ', f
@@ -2080,35 +2080,33 @@
 oneNumber: '
-25472616668
+072686382
 5',%0A        

Add airtime test cases