public void Cleanup() { SPSite spSite = new SPSite("http://localhost:9001/sites/pssportal"); SPContext spContext = SPContext.GetContext(spSite.RootWeb); Isolate.WhenCalled(() => SPContext.Current.Site).WillReturn(spSite); Isolate.WhenCalled(() => SPContext.Current).WillReturn(spContext); List <string> keys = new List <string>() { "IntegrationTest-FarmLevelKey", "IntegrationTest-WebAppLevelKey", "IntegrationTest-SiteLevelKey", "IntegrationTest-WebLevelKey" }; HierarchicalConfig hierarchicalConfig = new HierarchicalConfig(); foreach (string key in keys) { hierarchicalConfig.RemoveKeyFromPropertyBag(key, SPContext.Current.Web); hierarchicalConfig.RemoveKeyFromPropertyBag(key, SPContext.Current.Site); hierarchicalConfig.RemoveKeyFromPropertyBag(key, SPContext.Current.Site.WebApplication); hierarchicalConfig.RemoveKeyFromPropertyBag(key, SPFarm.Local); } Isolate.CleanUp(); }
public void AfterContextCleanup() { Isolate.CleanUp(); ReflectionHelper.Reset(); XafTypesInfo.Reset(); XafTypesInfo.HardReset(); XpoTypesInfoHelper.GetXpoTypeInfoSource().ResetDictionary(); }
private void SetUpGenFormWebConfiguration() { Isolate.CleanUp(); _configuration = WebConfigurationManager.OpenWebConfiguration("/GenForm"); _factory = Isolate.Fake.Instance <ConfigurationFactory>(); Isolate.WhenCalled(() => _factory.GetConfiguration()).WillReturn(_configuration); _configSettingSource = new ConfigurationSettingSource(_factory); }
public void SetANewConnectionWhenConnectionCacheIsEmptyAndInMemoryDatabase() { Isolate.CleanUp(); _cache = Isolate.Fake.Instance <IConnectionCache>(); _connection = Isolate.Fake.Instance <IDbConnection>(); Isolate.WhenCalled(() => _cache.HasNoConnection).WillReturn(true); Isolate.WhenCalled(() => _cache.GetConnection()).WillReturn(_connection); Isolate.WhenCalled(() => _cache.SetConnection(_connection)).IgnoreCall(); Isolate.WhenCalled(() => _connection.ConnectionString).WillReturn(SqLiteConfig.InMemoryDbConnectionString); InitCache(); _config = new SqLiteConfig(); _config.GetConnection(); Isolate.Verify.WasCalledWithAnyArguments(() => _cache.SetConnection(_connection)); }
public void NotAcceptTheSameSettingTwice() { Isolate.CleanUp(); var envs = GetIsolatedEnvironmentSettingsCollection(); envs.AddSetting("Test", "Test", "Test", "Test", string.Empty); try { envs.AddSetting("Test", "Test", "Test", "Test", string.Empty); Assert.Fail("should not accept the same setting twice"); } catch (Exception e) { Assert.IsNotInstanceOfType(e, typeof(AssertFailedException), e.ToString()); } }
public void Cleanup() { SharePointServiceLocator.Reset(); Isolate.CleanUp(); }
public void Cleanup() { Isolate.CleanUp(); }
public void CleanupMocks() { Isolate.CleanUp(); SharePointServiceLocator.Reset(); }
public void TearDown() { Isolate.CleanUp(); }
public void SetUp() { Isolate.CleanUp(); }
public void Cleanup() { Isolate.CleanUp(); SharePointServiceLocator.ReplaceCurrentServiceLocator(null); }
public void TestCleanup() { Isolate.CleanUp(); SharePointServiceLocator.Reset(); }
public void Init() { Isolate.CleanUp(); }