/**
 * Created by TalhaAkkas on 05/05/15.
 */
var MessageServer = require("..");
var assert = require("assert");
describe("It Should Pass", function (){
	it("It Should Pass", function () {
		assert(true);
	});
});

describe("It Should Send Message To Each Other", function (){
	it("It should call pre and post functions ", function(){
		require('..')();
		var a = function(){
			console.log("Hello World", arguments);
		}
		a = a.goAOPsync();
		a.preCall = function(){
			EWLog("callmeee");
		};
		a.postCall = function(){
			EWLog("callmeee opst");
		};
		a();


		console.log("--------")
		var b = function(cb){
			console.log("tol");
			cb("kelaj");
		}
		b  = b.goAOP();

		//EWLog(b.preCall);
		b.preCall = function(next){
			EWLog("callmeee");
			next.apply(this,arguments);
		};
		b.postCall = function(next){
			EWLog("callmeee opst");
			//next.apply(this,arguments);
		};
		//EWLog(b, b.preCall);
		b(function(name){
			console.log("bizedemi lolo >>>",name, arguments)
		})

	});
});
