text: 'use strict';
  'use-strict';
  
  var _powerAssertVisitorKeys = '{"ArrayExpression":["elements"],"AssignmentExpression":["left","right"],"BinaryExpression":["left","right"],"Directive":["value"],"DirectiveLiteral":[],"BlockStatement":["directives","body"],"BreakStatement":["label"],"CallExpression":["callee","arguments"],"CatchClause":["param","body"],"ConditionalExpression":["test","consequent","alternate"],"ContinueStatement":["label"],"DebuggerStatement":[],"DoWhileStatement":["test","body"],"EmptyStatement":[],"ExpressionStatement":["expression"],"File":["program"],"ForInStatement":["left","right","body"],"ForStatement":["init","test","update","body"],"FunctionDeclaration":["id","params","body","returnType","typeParameters"],"FunctionExpression":["id","params","body","returnType","typeParameters"],"Identifier":["typeAnnotation"],"IfStatement":["test","consequent","alternate"],"LabeledStatement":["label","body"],"StringLiteral":[],"NumericLiteral":[],"NullLiteral":[],"BooleanLiteral":[],"RegExpLiteral":[],"LogicalExpression":["left","right"],"MemberExpression":["object","property"],"NewExpression":["callee","arguments"],"Program":["directives","body"],"ObjectExpression":["properties"],"ObjectMethod":["key","params","body","decorators","returnType","typeParameters"],"ObjectProperty":["key","value","decorators"],"RestElement":["argument","typeAnnotation"],"ReturnStatement":["argument"],"SequenceExpression":["expressions"],"SwitchCase":["test","consequent"],"SwitchStatement":["discriminant","cases"],"ThisExpression":[],"ThrowStatement":["argument"],"TryStatement":["block","handler","finalizer"],"UnaryExpression":["argument"],"UpdateExpression":["argument"],"VariableDeclaration":["declarations"],"VariableDeclarator":["id","init"],"WhileStatement":["test","body"],"WithStatement":["object","body"],"AssignmentPattern":["left","right"],"ArrayPattern":["elements","typeAnnotation"],"ArrowFunctionExpression":["params","body","returnType","typeParameters"],"ClassBody":["body"],"ClassDeclaration":["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],"ClassExpression":["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],"ExportAllDeclaration":["source"],"ExportDefaultDeclaration":["declaration"],"ExportNamedDeclaration":["declaration","specifiers","source"],"ExportSpecifier":["local","exported"],"ForOfStatement":["left","right","body"],"ImportDeclaration":["specifiers","source"],"ImportDefaultSpecifier":["local"],"ImportNamespaceSpecifier":["local"],"ImportSpecifier":["local","imported"],"MetaProperty":["meta","property"],"ClassMethod":["key","params","body","decorators","returnType","typeParameters"],"ObjectPattern":["properties","typeAnnotation"],"SpreadElement":["argument"],"Super":[],"TaggedTemplateExpression":["tag","quasi"],"TemplateElement":[],"TemplateLiteral":["quasis","expressions"],"YieldExpression":["argument"],"AnyTypeAnnotation":[],"ArrayTypeAnnotation":["elementType"],"BooleanTypeAnnotation":[],"BooleanLiteralTypeAnnotation":[],"NullLiteralTypeAnnotation":[],"ClassImplements":["id","typeParameters"],"ClassProperty":["key","value","typeAnnotation","decorators"],"DeclareClass":["id","typeParameters","extends","body"],"DeclareFunction":["id"],"DeclareInterface":["id","typeParameters","extends","body"],"DeclareModule":["id","body"],"DeclareModuleExports":["typeAnnotation"],"DeclareTypeAlias":["id","typeParameters","right"],"DeclareOpaqueType":["id","typeParameters","supertype"],"DeclareVariable":["id"],"DeclareExportDeclaration":["declaration","specifiers","source"],"ExistentialTypeParam":[],"FunctionTypeAnnotation":["typeParameters","params","rest","returnType"],"FunctionTypeParam":["name","typeAnnotation"],"GenericTypeAnnotation":["id","typeParameters"],"InterfaceExtends":["id","typeParameters"],"InterfaceDeclaration":["id","typeParameters","extends","body"],"IntersectionTypeAnnotation":["types"],"MixedTypeAnnotation":[],"EmptyTypeAnnotation":[],"NullableTypeAnnotation":["typeAnnotation"],"NumericLiteralTypeAnnotation":[],"NumberTypeAnnotation":[],"StringLiteralTypeAnnotation":[],"StringTypeAnnotation":[],"ThisTypeAnnotation":[],"TupleTypeAnnotation":["types"],"TypeofTypeAnnotation":["argument"],"TypeAlias":["id","typeParameters","right"],"OpaqueType":["id","typeParameters","impltype","supertype"],"TypeAnnotation":["typeAnnotation"],"TypeCastExpression":["expression","typeAnnotation"],"TypeParameter":["bound"],"TypeParameterDeclaration":["params"],"TypeParameterInstantiation":["params"],"ObjectTypeAnnotation":["properties","indexers","callProperties"],"ObjectTypeCallProperty":["value"],"ObjectTypeIndexer":["id","key","value"],"ObjectTypeProperty":["key","value"],"ObjectTypeSpreadProperty":["argument"],"QualifiedTypeIdentifier":["id","qualification"],"UnionTypeAnnotation":["types"],"VoidTypeAnnotation":[],"JSXAttribute":["name","value"],"JSXClosingElement":["name"],"JSXElement":["openingElement","children","closingElement"],"JSXEmptyExpression":[],"JSXExpressionContainer":["expression"],"JSXSpreadChild":["expression"],"JSXIdentifier":[],"JSXMemberExpression":["object","property"],"JSXNamespacedName":["namespace","name"],"JSXOpeningElement":["name","attributes"],"JSXSpreadAttribute":["argument"],"JSXText":[],"Noop":[],"ParenthesizedExpression":["expression"],"AwaitExpression":["argument"],"ForAwaitStatement":["left","right","body"],"BindExpression":["object","callee"],"Import":[],"Decorator":["expression"],"DoExpression":["body"],"ExportDefaultSpecifier":["exported"],"ExportNamespaceSpecifier":["exported"],"RestProperty":["argument"],"SpreadProperty":["argument"]}',
      _powerAssertRecorder = function () { function PowerAssertRecorder() { this.captured = []; } PowerAssertRecorder.prototype._capt = function _capt(value, espath) { this.captured.push({ value: value, espath: espath }); return value; }; PowerAssertRecorder.prototype._expr = function _expr(value, source) { var capturedValues = this.captured; this.captured = []; return { powerAssertContext: { value: value, events: capturedValues }, source: source }; }; return PowerAssertRecorder; }();
  
  const test = require('ava');
  const sinon = require('sinon');
  const proxyquire = require('proxyquire');
  const agentFixtures = require('./fixtures/agent');
  // ----------------------------------------------------------
  let config = {
    logging: function () {}
    // ----------------------------------------------------
  
  };let MetricStub = {
    belongsTo: sinon.spy() // un spy es un funcion que nos dice datos sobre la funcion, es un chicmoso vamos
  
    // -------------------------------------------------------------
  
  };let id = 1;
  let uuid = 'yyy-yyy-yyy';
  let AgentStub = null;
  let db = null;
  let sandbox = null;
  
  // ----------------------------------------------
  let single = Object.assign({}, agentFixtures.single);
  // -----------------------------------------------------------------
  let connectedArgs = {
    where: { connected: true }
    // -------------------------------------------------------------
  };let usernameArgs = {
    where: { username: 'iot', connected: true }
    // ------------------------------------------------------------
  };let uuidArgs = {
    where: { uuid }
    // -------------------------------------------------------------
  };let newAgent = {
    uuid: '123-123-123',
    name: 'test',
    username: 'test',
    hostname: 'test',
    pid: 0,
    connected: false
  
    /* let uuidArgs = {
      where: {
        uuid
      }
    } */
  
  };test.beforeEach(async () => {
    sandbox = sinon.createSandbox();
  
    AgentStub = {
      // un sandbox es un ambiente especifico que solo funciona para este caso en particular
      hasMany: sandbox.spy()
  
      // Model create Stub
    };AgentStub.create = sandbox.stub();
    AgentStub.create.withArgs(newAgent).returns(Promise.resolve({
      toJSON() {
        return newAgent;
      }
    }));
  
    // Model update Stub
    AgentStub.update = sandbox.stub();
    AgentStub.update.withArgs(single, uuidArgs).returns(Promise.resolve(single));
  
    // Modelo findById Stub
    AgentStub.findById = sandbox.stub();
    AgentStub.findById.withArgs(id).returns(Promise.resolve(agentFixtures.byId(id)));
  
    // Model findOne Stub
    AgentStub.findOne = sandbox.stub();
    AgentStub.findOne.withArgs(uuidArgs).returns(Promise.resolve(agentFixtures.byUuid(uuid)));
  
    // Model findAll Stub
    AgentStub.findAll = sandbox.stub();
    AgentStub.findAll.withArgs().returns(Promise.resolve(agentFixtures.all));
    AgentStub.findAll.withArgs(connectedArgs).returns(Promise.resolve(agentFixtures.connected));
    AgentStub.findAll.withArgs(usernameArgs).returns(Promise.resolve(agentFixtures.iot));
  
    const setupDatabase = proxyquire('../', {
      './models/agent': () => AgentStub, // las mismas rutas que las que estan e declaradas en index.js
      './models/metric': () => MetricStub
    });
  
    db = await setupDatabase(config);
  });
  
  test.afterEach(() => {
    sandbox && sandbox.restore();
  });
  
  test('Agent', t => {
    var _rec = new _powerAssertRecorder();
  
    // verificacion de que Agent exista
    t.truthy(_rec._expr(_rec._capt(_rec._capt(db, 'arguments/0/object').Agent, 'arguments/0'), {
      content: 't.truthy(db.Agent, \'Agent service should exist\')',
      filepath: 'tests\\agent-tests.js',
      line: 99,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"truthy","range":[2,8]},"computed":false,"range":[0,8]},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"db","range":[9,11]},"property":{"type":"Identifier","name":"Agent","range":[12,17]},"computed":false,"range":[9,17]},{"type":"StringLiteral","value":"Agent service should exist","range":[19,47]}],"range":[0,48]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"name"},"value":"truthy","range":[2,8]},{"type":{"label":"("},"range":[8,9]},{"type":{"label":"name"},"value":"db","range":[9,11]},{"type":{"label":"."},"range":[11,12]},{"type":{"label":"name"},"value":"Agent","range":[12,17]},{"type":{"label":","},"range":[17,18]},{"type":{"label":"string"},"value":"Agent service should exist","range":[19,47]},{"type":{"label":")"},"range":[47,48]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'Agent service should exist'); // si se resulve el valor a verdadero
  });
  
  // ----------------------------------------------------------------
  test.serial('Setup', t => {
    var _rec2 = new _powerAssertRecorder(),
        _rec3 = new _powerAssertRecorder(),
        _rec4 = new _powerAssertRecorder(),
        _rec5 = new _powerAssertRecorder();
  
    t.true(_rec2._expr(_rec2._capt(_rec2._capt(_rec2._capt(AgentStub, 'arguments/0/object/object').hasMany, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.hasMany.called, \'AgentModel.hasMany fue ejecutada\')',
      filepath: 'tests\\agent-tests.js',
      line: 104,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"hasMany","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"AgentModel.hasMany fue ejecutada","range":[33,67]}],"range":[0,68]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"hasMany","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"AgentModel.hasMany fue ejecutada","range":[33,67]},{"type":{"label":")"},"range":[67,68]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'AgentModel.hasMany fue ejecutada');
    t.true(_rec3._expr(_rec3._capt(_rec3._capt(_rec3._capt(AgentStub, 'arguments/0/callee/object/object').hasMany, 'arguments/0/callee/object').calledWith(_rec3._capt(MetricStub, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.hasMany.calledWith(MetricStub), \'Argumento de esa funcion\')',
      filepath: 'tests\\agent-tests.js',
      line: 105,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"hasMany","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"MetricStub","range":[36,46]}],"range":[7,47]},{"type":"StringLiteral","value":"Argumento de esa funcion","range":[49,75]}],"range":[0,76]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"hasMany","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"MetricStub","range":[36,46]},{"type":{"label":")"},"range":[46,47]},{"type":{"label":","},"range":[47,48]},{"type":{"label":"string"},"value":"Argumento de esa funcion","range":[49,75]},{"type":{"label":")"},"range":[75,76]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'Argumento de esa funcion');
    t.true(_rec4._expr(_rec4._capt(_rec4._capt(_rec4._capt(MetricStub, 'arguments/0/object/object').belongsTo, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(MetricStub.belongsTo.called, \'MetricModel.belongsTo fue ejecutada\')',
      filepath: 'tests\\agent-tests.js',
      line: 106,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"MetricStub","range":[7,17]},"property":{"type":"Identifier","name":"belongsTo","range":[18,27]},"computed":false,"range":[7,27]},"property":{"type":"Identifier","name":"called","range":[28,34]},"computed":false,"range":[7,34]},{"type":"StringLiteral","value":"MetricModel.belongsTo fue ejecutada","range":[36,73]}],"range":[0,74]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"MetricStub","range":[7,17]},{"type":{"label":"."},"range":[17,18]},{"type":{"label":"name"},"value":"belongsTo","range":[18,27]},{"type":{"label":"."},"range":[27,28]},{"type":{"label":"name"},"value":"called","range":[28,34]},{"type":{"label":","},"range":[34,35]},{"type":{"label":"string"},"value":"MetricModel.belongsTo fue ejecutada","range":[36,73]},{"type":{"label":")"},"range":[73,74]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'MetricModel.belongsTo fue ejecutada');
    t.true(_rec5._expr(_rec5._capt(_rec5._capt(_rec5._capt(MetricStub, 'arguments/0/callee/object/object').belongsTo, 'arguments/0/callee/object').calledWith(_rec5._capt(AgentStub, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(MetricStub.belongsTo.calledWith(AgentStub), \'Argumentos de esa funcion\')',
      filepath: 'tests\\agent-tests.js',
      line: 107,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"MetricStub","range":[7,17]},"property":{"type":"Identifier","name":"belongsTo","range":[18,27]},"computed":false,"range":[7,27]},"property":{"type":"Identifier","name":"calledWith","range":[28,38]},"computed":false,"range":[7,38]},"arguments":[{"type":"Identifier","name":"AgentStub","range":[39,48]}],"range":[7,49]},{"type":"StringLiteral","value":"Argumentos de esa funcion","range":[51,78]}],"range":[0,79]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"MetricStub","range":[7,17]},{"type":{"label":"."},"range":[17,18]},{"type":{"label":"name"},"value":"belongsTo","range":[18,27]},{"type":{"label":"."},"range":[27,28]},{"type":{"label":"name"},"value":"calledWith","range":[28,38]},{"type":{"label":"("},"range":[38,39]},{"type":{"label":"name"},"value":"AgentStub","range":[39,48]},{"type":{"label":")"},"range":[48,49]},{"type":{"label":","},"range":[49,50]},{"type":{"label":"string"},"value":"Argumentos de esa funcion","range":[51,78]},{"type":{"label":")"},"range":[78,79]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'Argumentos de esa funcion');
  });
  // --------------------------------------------------------------------------
  test.serial('Agent#findById', async t => {
    var _rec6 = new _powerAssertRecorder(),
        _rec7 = new _powerAssertRecorder(),
        _rec8 = new _powerAssertRecorder();
  
    let agent = await db.Agent.findById(id);
  
    t.true(_rec6._expr(_rec6._capt(_rec6._capt(_rec6._capt(AgentStub, 'arguments/0/object/object').findById, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findById.called, \'findById debera llamar al modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 113,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findById","range":[17,25]},"computed":false,"range":[7,25]},"property":{"type":"Identifier","name":"called","range":[26,32]},"computed":false,"range":[7,32]},{"type":"StringLiteral","value":"findById debera llamar al modelo","range":[34,68]}],"range":[0,69]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findById","range":[17,25]},{"type":{"label":"."},"range":[25,26]},{"type":{"label":"name"},"value":"called","range":[26,32]},{"type":{"label":","},"range":[32,33]},{"type":{"label":"string"},"value":"findById debera llamar al modelo","range":[34,68]},{"type":{"label":")"},"range":[68,69]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findById debera llamar al modelo');
    t.true(_rec7._expr(_rec7._capt(_rec7._capt(_rec7._capt(AgentStub, 'arguments/0/object/object').findById, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.findById.calledOnce, \'findById debera ser llamada una vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 114,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findById","range":[17,25]},"computed":false,"range":[7,25]},"property":{"type":"Identifier","name":"calledOnce","range":[26,36]},"computed":false,"range":[7,36]},{"type":"StringLiteral","value":"findById debera ser llamada una vez","range":[38,75]}],"range":[0,76]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findById","range":[17,25]},{"type":{"label":"."},"range":[25,26]},{"type":{"label":"name"},"value":"calledOnce","range":[26,36]},{"type":{"label":","},"range":[36,37]},{"type":{"label":"string"},"value":"findById debera ser llamada una vez","range":[38,75]},{"type":{"label":")"},"range":[75,76]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findById debera ser llamada una vez');
    t.true(_rec8._expr(_rec8._capt(_rec8._capt(_rec8._capt(AgentStub, 'arguments/0/callee/object/object').findById, 'arguments/0/callee/object').calledWith(_rec8._capt(id, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.findById.calledWith(id), \'findById debera llamar con los argumentos que son\')',
      filepath: 'tests\\agent-tests.js',
      line: 115,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findById","range":[17,25]},"computed":false,"range":[7,25]},"property":{"type":"Identifier","name":"calledWith","range":[26,36]},"computed":false,"range":[7,36]},"arguments":[{"type":"Identifier","name":"id","range":[37,39]}],"range":[7,40]},{"type":"StringLiteral","value":"findById debera llamar con los argumentos que son","range":[42,93]}],"range":[0,94]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findById","range":[17,25]},{"type":{"label":"."},"range":[25,26]},{"type":{"label":"name"},"value":"calledWith","range":[26,36]},{"type":{"label":"("},"range":[36,37]},{"type":{"label":"name"},"value":"id","range":[37,39]},{"type":{"label":")"},"range":[39,40]},{"type":{"label":","},"range":[40,41]},{"type":{"label":"string"},"value":"findById debera llamar con los argumentos que son","range":[42,93]},{"type":{"label":")"},"range":[93,94]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findById debera llamar con los argumentos que son');
  
    t.deepEqual(agent, agentFixtures.byId(id), 'deberia ser el mismo');
  });
  // -----------------------------------------------------------------------
  test.serial('Agent#findByUuid', async t => {
    var _rec9 = new _powerAssertRecorder(),
        _rec10 = new _powerAssertRecorder(),
        _rec11 = new _powerAssertRecorder();
  
    let agent = await db.Agent.findByUuid(uuid);
  
    t.true(_rec9._expr(_rec9._capt(_rec9._capt(_rec9._capt(AgentStub, 'arguments/0/object/object').findOne, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findOne.called, \'findOne solo llamara al modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 123,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findOne solo llamara al modelo","range":[33,65]}],"range":[0,66]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findOne solo llamara al modelo","range":[33,65]},{"type":{"label":")"},"range":[65,66]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne solo llamara al modelo');
    t.true(_rec10._expr(_rec10._capt(_rec10._capt(_rec10._capt(AgentStub, 'arguments/0/object/object').findOne, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.findOne.calledOnce, \'findOne debera llamarse una sola vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 124,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findOne debera llamarse una sola vez","range":[37,75]}],"range":[0,76]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findOne debera llamarse una sola vez","range":[37,75]},{"type":{"label":")"},"range":[75,76]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamarse una sola vez');
    t.true(_rec11._expr(_rec11._capt(_rec11._capt(_rec11._capt(AgentStub, 'arguments/0/callee/object/object').findOne, 'arguments/0/callee/object').calledWith(_rec11._capt(uuidArgs, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.findOne.calledWith(uuidArgs), \'findOne debera llamar con argumentos\')',
      filepath: 'tests\\agent-tests.js',
      line: 125,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"uuidArgs","range":[36,44]}],"range":[7,45]},{"type":"StringLiteral","value":"findOne debera llamar con argumentos","range":[47,85]}],"range":[0,86]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"uuidArgs","range":[36,44]},{"type":{"label":")"},"range":[44,45]},{"type":{"label":","},"range":[45,46]},{"type":{"label":"string"},"value":"findOne debera llamar con argumentos","range":[47,85]},{"type":{"label":")"},"range":[85,86]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamar con argumentos');
  
    t.deepEqual(agent, agentFixtures.byUuid(uuid), 'agent debera ser el mismo');
  });
  // ------------------------------------------------------------------------------
  test.serial('Agent#findAll', async t => {
    var _rec12 = new _powerAssertRecorder(),
        _rec13 = new _powerAssertRecorder(),
        _rec14 = new _powerAssertRecorder();
  
    let agents = await db.Agent.findAll();
  
    t.true(_rec12._expr(_rec12._capt(_rec12._capt(_rec12._capt(AgentStub, 'arguments/0/object/object').findAll, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findAll.called, \'findAll debera ser llamado\')',
      filepath: 'tests\\agent-tests.js',
      line: 133,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findAll debera ser llamado","range":[33,61]}],"range":[0,62]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findAll debera ser llamado","range":[33,61]},{"type":{"label":")"},"range":[61,62]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado');
    t.true(_rec13._expr(_rec13._capt(_rec13._capt(_rec13._capt(AgentStub, 'arguments/0/object/object').findAll, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.findAll.calledOnce, \'findAll debera ser llamado una sola vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 134,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findAll debera ser llamado una sola vez","range":[37,78]}],"range":[0,79]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findAll debera ser llamado una sola vez","range":[37,78]},{"type":{"label":")"},"range":[78,79]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado una sola vez');
    t.true(_rec14._expr(_rec14._capt(_rec14._capt(_rec14._capt(AgentStub, 'arguments/0/callee/object/object').findAll, 'arguments/0/callee/object').calledWith(), 'arguments/0'), {
      content: 't.true(AgentStub.findAll.calledWith(), \'findAll debera ser llamado sin argumentos\')',
      filepath: 'tests\\agent-tests.js',
      line: 135,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[],"range":[7,37]},{"type":"StringLiteral","value":"findAll debera ser llamado sin argumentos","range":[39,82]}],"range":[0,83]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":")"},"range":[36,37]},{"type":{"label":","},"range":[37,38]},{"type":{"label":"string"},"value":"findAll debera ser llamado sin argumentos","range":[39,82]},{"type":{"label":")"},"range":[82,83]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado sin argumentos');
  
    t.is(agents.length, agentFixtures.all.length, 'agents deberan ser los mismos');
    t.deepEqual(agents, agentFixtures.all, 'agents deberan ser los mismos');
  });
  // --------------------------------------------------------------------
  test.serial('Agent#findConnected', async t => {
    var _rec15 = new _powerAssertRecorder(),
        _rec16 = new _powerAssertRecorder(),
        _rec17 = new _powerAssertRecorder();
  
    let agents = await db.Agent.findConnected();
  
    t.true(_rec15._expr(_rec15._capt(_rec15._capt(_rec15._capt(AgentStub, 'arguments/0/object/object').findAll, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findAll.called, \'findAll debera llamar al modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 144,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findAll debera llamar al modelo","range":[33,66]}],"range":[0,67]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findAll debera llamar al modelo","range":[33,66]},{"type":{"label":")"},"range":[66,67]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera llamar al modelo');
    t.true(_rec16._expr(_rec16._capt(_rec16._capt(_rec16._capt(AgentStub, 'arguments/0/object/object').findAll, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.findAll.calledOnce, \'findAll debera ser llamado una sola vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 145,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findAll debera ser llamado una sola vez","range":[37,78]}],"range":[0,79]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findAll debera ser llamado una sola vez","range":[37,78]},{"type":{"label":")"},"range":[78,79]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado una sola vez');
    t.true(_rec17._expr(_rec17._capt(_rec17._capt(_rec17._capt(AgentStub, 'arguments/0/callee/object/object').findAll, 'arguments/0/callee/object').calledWith(_rec17._capt(connectedArgs, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.findAll.calledWith(connectedArgs), \'findAll debera ser llamado con argumentos\')',
      filepath: 'tests\\agent-tests.js',
      line: 146,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"connectedArgs","range":[36,49]}],"range":[7,50]},{"type":"StringLiteral","value":"findAll debera ser llamado con argumentos","range":[52,95]}],"range":[0,96]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"connectedArgs","range":[36,49]},{"type":{"label":")"},"range":[49,50]},{"type":{"label":","},"range":[50,51]},{"type":{"label":"string"},"value":"findAll debera ser llamado con argumentos","range":[52,95]},{"type":{"label":")"},"range":[95,96]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado con argumentos');
  
    t.is(agents.length, agentFixtures.connected.length, 'agents deberanser llamado');
    t.deepEqual(agents, agentFixtures.connected, 'agents debera ser el mismo');
  });
  // -------------------------------------------------------------
  
  test.serial('Agent#findByUsername', async t => {
    var _rec18 = new _powerAssertRecorder(),
        _rec19 = new _powerAssertRecorder(),
        _rec20 = new _powerAssertRecorder();
  
    let agents = await db.Agent.findByUsername('iot');
  
    t.true(_rec18._expr(_rec18._capt(_rec18._capt(_rec18._capt(AgentStub, 'arguments/0/object/object').findAll, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findAll.called, \'findAll debera llamar el modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 156,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findAll debera llamar el modelo","range":[33,66]}],"range":[0,67]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findAll debera llamar el modelo","range":[33,66]},{"type":{"label":")"},"range":[66,67]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera llamar el modelo');
    t.true(_rec19._expr(_rec19._capt(_rec19._capt(_rec19._capt(AgentStub, 'arguments/0/object/object').findAll, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.findAll.calledOnce, \'findAll debera ser llamado una sola vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 157,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findAll debera ser llamado una sola vez","range":[37,78]}],"range":[0,79]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findAll debera ser llamado una sola vez","range":[37,78]},{"type":{"label":")"},"range":[78,79]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado una sola vez');
    t.true(_rec20._expr(_rec20._capt(_rec20._capt(_rec20._capt(AgentStub, 'arguments/0/callee/object/object').findAll, 'arguments/0/callee/object').calledWith(_rec20._capt(usernameArgs, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.findAll.calledWith(usernameArgs), \'findAll debera ser llamado con argumentos\')',
      filepath: 'tests\\agent-tests.js',
      line: 158,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"usernameArgs","range":[36,48]}],"range":[7,49]},{"type":"StringLiteral","value":"findAll debera ser llamado con argumentos","range":[51,94]}],"range":[0,95]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"usernameArgs","range":[36,48]},{"type":{"label":")"},"range":[48,49]},{"type":{"label":","},"range":[49,50]},{"type":{"label":"string"},"value":"findAll debera ser llamado con argumentos","range":[51,94]},{"type":{"label":")"},"range":[94,95]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findAll debera ser llamado con argumentos');
  
    t.is(agents.length, agentFixtures.iot.length, 'agents deneran ser los mismos');
    t.deepEqual(agents, agentFixtures.iot, 'agents deberan ser los mismos');
  });
  // ---------------------------------------------------
  test.serial('Agent#createOrUpdate - exists', async t => {
    var _rec21 = new _powerAssertRecorder(),
        _rec22 = new _powerAssertRecorder(),
        _rec23 = new _powerAssertRecorder(),
        _rec24 = new _powerAssertRecorder(),
        _rec25 = new _powerAssertRecorder(),
        _rec26 = new _powerAssertRecorder();
  
    let agent = await db.Agent.createOrUpdate(single);
  
    t.true(_rec21._expr(_rec21._capt(_rec21._capt(_rec21._capt(AgentStub, 'arguments/0/object/object').findOne, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findOne.called, \'findOne debera llamar al modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 167,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findOne debera llamar al modelo","range":[33,66]}],"range":[0,67]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findOne debera llamar al modelo","range":[33,66]},{"type":{"label":")"},"range":[66,67]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamar al modelo');
    t.true(_rec22._expr(_rec22._capt(_rec22._capt(_rec22._capt(AgentStub, 'arguments/0/object/object').findOne, 'arguments/0/object').calledTwice, 'arguments/0'), {
      content: 't.true(AgentStub.findOne.calledTwice, \'findOne debera llamar dos veces\')',
      filepath: 'tests\\agent-tests.js',
      line: 168,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledTwice","range":[25,36]},"computed":false,"range":[7,36]},{"type":"StringLiteral","value":"findOne debera llamar dos veces","range":[38,71]}],"range":[0,72]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledTwice","range":[25,36]},{"type":{"label":","},"range":[36,37]},{"type":{"label":"string"},"value":"findOne debera llamar dos veces","range":[38,71]},{"type":{"label":")"},"range":[71,72]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamar dos veces');
    t.true(_rec23._expr(_rec23._capt(_rec23._capt(_rec23._capt(AgentStub, 'arguments/0/callee/object/object').findOne, 'arguments/0/callee/object').calledWith(_rec23._capt(uuidArgs, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.findOne.calledWith(uuidArgs), \'findOne debe ser llamado con argumentos\')',
      filepath: 'tests\\agent-tests.js',
      line: 169,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"uuidArgs","range":[36,44]}],"range":[7,45]},{"type":"StringLiteral","value":"findOne debe ser llamado con argumentos","range":[47,88]}],"range":[0,89]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"uuidArgs","range":[36,44]},{"type":{"label":")"},"range":[44,45]},{"type":{"label":","},"range":[45,46]},{"type":{"label":"string"},"value":"findOne debe ser llamado con argumentos","range":[47,88]},{"type":{"label":")"},"range":[88,89]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debe ser llamado con argumentos');
    t.true(_rec24._expr(_rec24._capt(_rec24._capt(_rec24._capt(AgentStub, 'arguments/0/object/object').update, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.update.called, \'agent.update llama un modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 170,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"update","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"called","range":[24,30]},"computed":false,"range":[7,30]},{"type":"StringLiteral","value":"agent.update llama un modelo","range":[32,62]}],"range":[0,63]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"update","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"called","range":[24,30]},{"type":{"label":","},"range":[30,31]},{"type":{"label":"string"},"value":"agent.update llama un modelo","range":[32,62]},{"type":{"label":")"},"range":[62,63]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'agent.update llama un modelo');
    t.true(_rec25._expr(_rec25._capt(_rec25._capt(_rec25._capt(AgentStub, 'arguments/0/object/object').update, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.update.calledOnce, \'update debera ser llamado una sola vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 171,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"update","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"calledOnce","range":[24,34]},"computed":false,"range":[7,34]},{"type":"StringLiteral","value":"update debera ser llamado una sola vez","range":[36,76]}],"range":[0,77]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"update","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"calledOnce","range":[24,34]},{"type":{"label":","},"range":[34,35]},{"type":{"label":"string"},"value":"update debera ser llamado una sola vez","range":[36,76]},{"type":{"label":")"},"range":[76,77]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'update debera ser llamado una sola vez');
    t.true(_rec26._expr(_rec26._capt(_rec26._capt(_rec26._capt(AgentStub, 'arguments/0/callee/object/object').update, 'arguments/0/callee/object').calledWith(_rec26._capt(single, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.update.calledWith(single), \'agent.update debera ser llamado singularmente\')',
      filepath: 'tests\\agent-tests.js',
      line: 172,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"update","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"calledWith","range":[24,34]},"computed":false,"range":[7,34]},"arguments":[{"type":"Identifier","name":"single","range":[35,41]}],"range":[7,42]},{"type":"StringLiteral","value":"agent.update debera ser llamado singularmente","range":[44,91]}],"range":[0,92]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"update","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"calledWith","range":[24,34]},{"type":{"label":"("},"range":[34,35]},{"type":{"label":"name"},"value":"single","range":[35,41]},{"type":{"label":")"},"range":[41,42]},{"type":{"label":","},"range":[42,43]},{"type":{"label":"string"},"value":"agent.update debera ser llamado singularmente","range":[44,91]},{"type":{"label":")"},"range":[91,92]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'agent.update debera ser llamado singularmente');
  
    t.deepEqual(agent, single, 'el agent deberia ser el mismo');
  });
  // ------------------------------------------------------------
  test.serial('Agent#createOrUpdate - new', async t => {
    var _rec27 = new _powerAssertRecorder(),
        _rec28 = new _powerAssertRecorder(),
        _rec29 = new _powerAssertRecorder(),
        _rec30 = new _powerAssertRecorder(),
        _rec31 = new _powerAssertRecorder(),
        _rec32 = new _powerAssertRecorder();
  
    let agent = await db.Agent.createOrUpdate(newAgent);
  
    t.true(_rec27._expr(_rec27._capt(_rec27._capt(_rec27._capt(AgentStub, 'arguments/0/object/object').findOne, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.findOne.called, \'findOne debera llamar una vez al objeto\')',
      filepath: 'tests\\agent-tests.js',
      line: 180,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findOne debera llamar una vez al objeto","range":[33,74]}],"range":[0,75]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findOne debera llamar una vez al objeto","range":[33,74]},{"type":{"label":")"},"range":[74,75]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamar una vez al objeto');
    t.true(_rec28._expr(_rec28._capt(_rec28._capt(_rec28._capt(AgentStub, 'arguments/0/object/object').findOne, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.findOne.calledOnce, \'findOne debera llamar una vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 181,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findOne debera llamar una vez","range":[37,68]}],"range":[0,69]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findOne debera llamar una vez","range":[37,68]},{"type":{"label":")"},"range":[68,69]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamar una vez');
    t.true(_rec29._expr(_rec29._capt(_rec29._capt(_rec29._capt(AgentStub, 'arguments/0/callee/object/object').findOne, 'arguments/0/callee/object').calledWith(_rec29._capt({
      where: _rec29._capt({ uuid: _rec29._capt(_rec29._capt(newAgent, 'arguments/0/arguments/0/properties/0/value/properties/0/value/object').uuid, 'arguments/0/arguments/0/properties/0/value/properties/0/value') }, 'arguments/0/arguments/0/properties/0/value')
    }, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.findOne.calledWith({ where: { uuid: newAgent.uuid } }), \'findOne debera llamar los argumentos de uuid args\')',
      filepath: 'tests\\agent-tests.js',
      line: 182,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"ObjectExpression","properties":[{"type":"ObjectProperty","key":{"type":"Identifier","name":"where","range":[38,43]},"value":{"type":"ObjectExpression","properties":[{"type":"ObjectProperty","key":{"type":"Identifier","name":"uuid","range":[47,51]},"value":{"type":"MemberExpression","object":{"type":"Identifier","name":"newAgent","range":[53,61]},"property":{"type":"Identifier","name":"uuid","range":[62,66]},"computed":false,"range":[53,66]},"computed":false,"shorthand":false,"range":[47,66]}],"range":[45,68]},"computed":false,"shorthand":false,"range":[38,68]}],"range":[36,70]}],"range":[7,71]},{"type":"StringLiteral","value":"findOne debera llamar los argumentos de uuid args","range":[73,124]}],"range":[0,125]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"{"},"range":[36,37]},{"type":{"label":"name"},"value":"where","range":[38,43]},{"type":{"label":":"},"range":[43,44]},{"type":{"label":"{"},"range":[45,46]},{"type":{"label":"name"},"value":"uuid","range":[47,51]},{"type":{"label":":"},"range":[51,52]},{"type":{"label":"name"},"value":"newAgent","range":[53,61]},{"type":{"label":"."},"range":[61,62]},{"type":{"label":"name"},"value":"uuid","range":[62,66]},{"type":{"label":"}"},"range":[67,68]},{"type":{"label":"}"},"range":[69,70]},{"type":{"label":")"},"range":[70,71]},{"type":{"label":","},"range":[71,72]},{"type":{"label":"string"},"value":"findOne debera llamar los argumentos de uuid args","range":[73,124]},{"type":{"label":")"},"range":[124,125]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'findOne debera llamar los argumentos de uuid args');
    t.true(_rec30._expr(_rec30._capt(_rec30._capt(_rec30._capt(AgentStub, 'arguments/0/object/object').create, 'arguments/0/object').called, 'arguments/0'), {
      content: 't.true(AgentStub.create.called, \'create debera llamar un modelo\')',
      filepath: 'tests\\agent-tests.js',
      line: 185,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"create","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"called","range":[24,30]},"computed":false,"range":[7,30]},{"type":"StringLiteral","value":"create debera llamar un modelo","range":[32,64]}],"range":[0,65]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"create","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"called","range":[24,30]},{"type":{"label":","},"range":[30,31]},{"type":{"label":"string"},"value":"create debera llamar un modelo","range":[32,64]},{"type":{"label":")"},"range":[64,65]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'create debera llamar un modelo');
    t.true(_rec31._expr(_rec31._capt(_rec31._capt(_rec31._capt(AgentStub, 'arguments/0/object/object').create, 'arguments/0/object').calledOnce, 'arguments/0'), {
      content: 't.true(AgentStub.create.calledOnce, \'create debera llamarse una vez\')',
      filepath: 'tests\\agent-tests.js',
      line: 186,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"create","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"calledOnce","range":[24,34]},"computed":false,"range":[7,34]},{"type":"StringLiteral","value":"create debera llamarse una vez","range":[36,68]}],"range":[0,69]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"create","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"calledOnce","range":[24,34]},{"type":{"label":","},"range":[34,35]},{"type":{"label":"string"},"value":"create debera llamarse una vez","range":[36,68]},{"type":{"label":")"},"range":[68,69]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'create debera llamarse una vez');
    t.true(_rec32._expr(_rec32._capt(_rec32._capt(_rec32._capt(AgentStub, 'arguments/0/callee/object/object').create, 'arguments/0/callee/object').calledWith(_rec32._capt(newAgent, 'arguments/0/arguments/0')), 'arguments/0'), {
      content: 't.true(AgentStub.create.calledWith(newAgent), \'create debera llamarse con argumentos\')',
      filepath: 'tests\\agent-tests.js',
      line: 187,
      async: true,
      ast: '{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"create","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"calledWith","range":[24,34]},"computed":false,"range":[7,34]},"arguments":[{"type":"Identifier","name":"newAgent","range":[35,43]}],"range":[7,44]},{"type":"StringLiteral","value":"create debera llamarse con argumentos","range":[46,85]}],"range":[0,86]}',
      tokens: '[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"create","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"calledWith","range":[24,34]},{"type":{"label":"("},"range":[34,35]},{"type":{"label":"name"},"value":"newAgent","range":[35,43]},{"type":{"label":")"},"range":[43,44]},{"type":{"label":","},"range":[44,45]},{"type":{"label":"string"},"value":"create debera llamarse con argumentos","range":[46,85]},{"type":{"label":")"},"range":[85,86]}]',
      visitorKeys: _powerAssertVisitorKeys
    }), 'create debera llamarse con argumentos');
  
    t.deepEqual(agent.newAgent, 'agent debera llamarse solo');
  });
  // ---------------------------------------------------------------------
  //# sourceMappingURL=C:\Users\Angel Barusta\Desktop\nodejs\iot_nodejs\node_modules\.cache\ava\5a73248edc2ec475228bc2f3b9713f63.js.map