public RoomContext(CampfireApiFake campfireApiFake) { var bootstrapper = new Bootstrapper { TestMode = true }; _container = bootstrapper.Container; _container.Kernel.ComponentCreated += KernelOnComponentCreated; _campfireApiFake = campfireApiFake; _container.Register(Component.For <ICampfireApi>().Instance(_campfireApiFake)); _loader = new MockSettingsLoader(); _container.Register(Component.For <ISettingsLoader>().Instance(_loader)); _container.Register(Component.For <Func <NotificationAction, INotificationAction> >().Instance(CreateNotificationAction)); _container.Register( Component.For <IApplicationActivator>().Instance( (ApplicationActivatorMock = new Mock <IApplicationActivator>()).Object)); _fakeClipboardService = new FakeClipBoardService(); _container.Register(Component.For <IClipboardService>().Instance(_fakeClipboardService)); _container.Register(Component.For <IPasteView>().ImplementedBy <FakePasteView>().LifestyleTransient()); bootstrapper.Bootstrap(); _container.Install(FromAssembly.This()); _bus = _container.Resolve <IMessageBus>(); Listen <RequestRecentMessagesMessage>(); _bus.SendMessage(new ApplicationLoadedMessage()); object dummy = _container.Resolve <IToastWindow>(); dummy = _container.Resolve <ISettingsViewModel>(); _componentCounts = new Dictionary <Type, int>(); _container.Kernel.ComponentCreated += (model, instance) => { int count = 0; _componentCounts.TryGetValue(instance.GetType(), out count); count++; _componentCounts[instance.GetType()] = count; }; _container.Kernel.ComponentDestroyed += (model, instance) => { int count = _componentCounts[instance.GetType()]; count--; _componentCounts[instance.GetType()] = count; }; }
public LoginSteps(RoomContext context, CampfireApiFake campfireApiFake) { _context = context; _campfireApiFake = campfireApiFake; }