public void TestEvent_StaticEventField() { bool eventRaised = false; m_moduleBuilder.SetEventHandler(nameof(SimpleNativeModule.OnIntResult2), (int eventArg) => { Assert.AreEqual(64, eventArg); eventRaised = true; }); SimpleNativeModule.OnIntResult2(64); Assert.IsTrue(eventRaised); }
public void TestEvent_StaticEventProperty() { bool eventRaised = false; m_moduleBuilder.SetEventHandler("onPointResult4", (Point eventArg) => { Assert.AreEqual(32, eventArg.X); Assert.AreEqual(42, eventArg.Y); eventRaised = true; }); SimpleNativeModule.OnPointResult4(new Point { X = 32, Y = 42 }); Assert.IsTrue(eventRaised); }
public void Initialize() { m_moduleBuilder = new ReactModuleBuilderMock(); m_moduleInfo = new ReactModuleInfo(typeof(SimpleNativeModule), "SimpleNativeModule", "SimpleNativeModule"); m_module = (SimpleNativeModule)m_moduleInfo.ModuleProvider(m_moduleBuilder); }