Exemplo n.º 1
0
        public void SoulEventInvokeTest()
        {
            TestType obj  = NSubstitute.Substitute.For <TestType>();
            var      soul = new SoulProxy(0, 0, typeof(TestType), obj);

            string eventCatcher          = "";
            InvokeEventCallabck callback = (entiry_id, event_id, handler_id, args) =>
            {
                eventCatcher = $"{entiry_id}-{event_id}-{handler_id}";
            };
            GenericEventClosure closure = new GenericEventClosure(1, 1, 1, callback);

            System.Reflection.EventInfo info = typeof(TestType).GetEvent("TestEvent");
            soul.AddEvent(new SoulProxyEventHandler(obj, new System.Action(closure.Run), info, 1));

            obj.TestEvent += Raise.Event <Action>();

            Assert.Equal("1-1-1", eventCatcher);

            soul.RemoveEvent(info, 1);
        }
Exemplo n.º 2
0
 public SoulTest()
 {
     ipcCltProxy = ipcClient.CreateSoulProxy();
 }