Ejemplo n.º 1
0
Archivo: Test.cs Proyecto: jblj/mobile
        public virtual void SetUp ()
        {
            syncContext = new MainThreadSynchronizationContext ();
            SynchronizationContext.SetSynchronizationContext (syncContext);

            // Create MessageBus egerly to avoid it being created in the background thread with invalid synchronization context.
            ServiceContainer.Register<MessageBus> (new MessageBus ());
            ServiceContainer.Register<ITimeProvider> (() => new DefaultTimeProvider ());
            ServiceContainer.Register<IDataStore> (delegate {
                databasePath = Path.GetTempFileName ();
                return new SqliteDataStore (databasePath);
            });
        }
Ejemplo n.º 2
0
        public virtual void SetUp()
        {
            syncContext = new MainThreadSynchronizationContext();
            SynchronizationContext.SetSynchronizationContext(syncContext);

            // Create MessageBus egerly to avoid it being created in the background thread with invalid synchronization context.
            ServiceContainer.Register <MessageBus> (new MessageBus());
            ServiceContainer.Register <ITimeProvider> (() => new DefaultTimeProvider());
            ServiceContainer.Register <TimeCorrectionManager> ();
            ServiceContainer.Register <IDataStore> (delegate {
                databasePath = Path.GetTempFileName();
                return(new SqliteDataStore(databasePath));
            });
            ServiceContainer.Register <LogStore> ((LogStore)null);
            ServiceContainer.Register <IBugsnagClient> ((IBugsnagClient)null);
            ServiceContainer.Register <ILogger> (() => new VoidLogger());
        }
Ejemplo n.º 3
0
        public virtual void SetUp ()
        {
            syncContext = new MainThreadSynchronizationContext ();
            SynchronizationContext.SetSynchronizationContext (syncContext);

            // Create MessageBus egerly to avoid it being created in the background thread with invalid synchronization context.
            ServiceContainer.Register<MessageBus> (new MessageBus ());
            ServiceContainer.Register<ITimeProvider> (() => new DefaultTimeProvider ());
            ServiceContainer.Register<TimeCorrectionManager> ();
            ServiceContainer.Register<IDataStore> (delegate {
                databasePath = Path.GetTempFileName ();
                return new SqliteDataStore (databasePath, new SQLitePlatformGeneric ());
            });
            ServiceContainer.Register<LogStore> ((LogStore)null);
            ServiceContainer.Register<ILoggerClient> ((ILoggerClient)null);
            ServiceContainer.Register<ILogger> (() => new VoidLogger());
        }