/// ------------------------------------------------------------------------------------ /// <summary> /// This is the implementation for the static constructor. It is in a separate method /// to allow tests to reset it (using reflection). /// </summary> /// ------------------------------------------------------------------------------------ public static void SetCurrentToDb4OBackend(IFdoUI ui, IFdoDirectories dirs, Func<bool> usingDefaultProjectsDirAccessor) { // This is the "one line" that should need to be changed to configure a different backend :-). // Typically a new implementation of IClientServerServices will be needed, as well as the backend itself. Current = new Db4OClientServerServices(ui, dirs, usingDefaultProjectsDirAccessor); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Fixture setup. /// </summary> /// ------------------------------------------------------------------------------------ public override void FixtureSetup() { base.FixtureSetup(); IClientServerServices clientSvcs = MockRepository.GenerateStub <IClientServerServices>(); ReflectionHelper.SetProperty(typeof(ClientServerServices), "Current", clientSvcs); m_localCsSvcs = MockRepository.GenerateStub <ILocalClientServerServices>(); clientSvcs.Stub(x => x.Local).Return(m_localCsSvcs); m_localCsSvcs.Stub(cs => cs.DefaultBackendType).Do(new Func <FDOBackendProviderType>(() => m_defaultBepType)); }