1
namespace Org
.Lwes
.Tests
4 using System
.Collections
.Generic
;
8 using System
.Threading
;
10 using Microsoft
.VisualStudio
.TestTools
.UnitTesting
;
12 using Org
.Lwes
.Emitter
;
13 using Org
.Lwes
.Listener
;
16 public class EventEmitterTests
20 Random _rand
= new Random(Environment
.TickCount
);
27 public void AccessDefaultListener()
31 EventName
= "UserLogin",
34 UserName
= new { Name = "username", Token = TypeToken.STRING, Value = "bob" }
,
35 Password
= new { Name = "password", Token = TypeToken.UINT64, Value = 0xfeedabbadeadbeefUL }
,
36 ClientIP
= new { Name = "clientIP", Token = TypeToken.IP_ADDR, Value = IPAddress.Parse("127.0.0.1") }
,
37 Successful
= new { Name = "successful", Token = TypeToken.BOOLEAN, Value = false }
41 // Create the event...
42 Event ev
= new Event(e
.EventName
)
43 .SetValue(e
.Attributes
.UserName
.Name
, e
.Attributes
.UserName
.Value
)
44 .SetValue(e
.Attributes
.Password
.Name
, e
.Attributes
.Password
.Value
)
45 .SetValue(e
.Attributes
.ClientIP
.Name
, e
.Attributes
.ClientIP
.Value
)
46 .SetValue(e
.Attributes
.Successful
.Name
, e
.Attributes
.Successful
.Value
);
48 IEventEmitter emitter
= EventEmitter
.CreateDefault();
49 Assert
.IsNotNull(emitter
);