public void UnbindListenerDeferred(EventKey key, Action <EventPayload> action, IEventContext evntContext) { if (_listenersToUnbind != null) { _listenersToUnbind.Add(evntContext.GetEvent(key), action); } else { UnbindListener(evntContext.GetEvent(key), action, evntContext); } }
public void SetUp() { _subEventContext = Substitute.For <IEventContext>(); _subEventContext.GetEvent(EventKey.FrameUpdate).Returns(new TofuEvent(EventKey.FrameUpdate)); _subServiceContext = TestUtilities.BuildSubServiceContextWithServices(new Dictionary <string, object> { { "IEventContext", _subEventContext } }); _playerContainer = new PlayerContainer(); _playerContainer.Build(); _playerContainer.BindServiceContext(_subServiceContext); _playerContainer.ResolveServiceBindings(); _playerContainer.Initialize(); }
public EventModel GetEvent(int id) { EventDTO dto = new EventDTO(); dto = Context.GetEvent(id); var modeltransfer = new EventModel() { Id = dto.Id, Name = dto.Name, Date = dto.Month, Description = dto.Description, EndTime = dto.EndTime, StartTime = dto.StartTime, Nrbar = dto.Nrbar, Nrevent = dto.Nrevent, Nriets = dto.Nriets, }; return(modeltransfer); }
public void SetUp() { //Prepare Bindings _subServiceContext = Substitute.For <IServiceContext>(); _subEventContext = Substitute.For <IEventContext>(); _subServiceContext.Has("IEventContext").Returns(true); _subServiceContext.Fetch("IEventContext").Returns(_subEventContext); //Prepare Events TofuEvent _frameUpdateEvent = new TofuEvent("FrameUpdate"); _subEventContext.GetEvent(EventKey.FrameUpdate).Returns(_frameUpdateEvent); //Prepare Object Under Test _glopContainer = new GlopContainer <Glop>(); _glopContainer.BindServiceContext(_subServiceContext); _glopContainer.ResolveServiceBindings(); _glopContainer.Build(); _glopContainer.Initialize(); }
public void BindListener(EventKey key, Action <EventPayload> action, IEventContext evntContext) { BindListener(evntContext.GetEvent(key), action, evntContext); }