3 describe('egEvent', function(){
4 beforeEach(module('egCoreMod'));
9 desc: "Test Event Description",
10 payload: {test : 'xyz'},
11 textcode: "TEST_EVENT",
12 servertime: "Wed Nov 6 16:05:50 2013"
15 it('should parse an event object', inject(function(egEvent) {
16 expect(egEvent.parse(evt)).not.toBe(null);
19 it('should not parse a non-event', inject(function(egEvent) {
20 expect(egEvent.parse({})).toBe(null);
23 it('should not parse a non-event', inject(function(egEvent) {
24 expect(egEvent.parse({abc : '123'})).toBe(null);
27 it('should not parse a non-event', inject(function(egEvent) {
28 expect(egEvent.parse([])).toBe(null);
31 it('should not parse a non-event', inject(function(egEvent) {
32 expect(egEvent.parse('STRING')).toBe(null);
35 it('should not parse a non-event', inject(function(egEvent) {
36 expect(egEvent.parse(true)).toBe(null);
39 it('should stringify an event', inject(function(egEvent) {
40 expect(egEvent.parse(evt).toString()).toBe(
41 'Event: 12345:TEST_EVENT -> Test Event Description')