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();
        }
Exemplo n.º 2
0
 public void AfterContextCleanup()
 {
     Isolate.CleanUp();
     ReflectionHelper.Reset();
     XafTypesInfo.Reset();
     XafTypesInfo.HardReset();
     XpoTypesInfoHelper.GetXpoTypeInfoSource().ResetDictionary();
 }
Exemplo n.º 3
0
        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());
            }
        }
Exemplo n.º 6
0
 public void Cleanup()
 {
     SharePointServiceLocator.Reset();
     Isolate.CleanUp();
 }
 public void Cleanup()
 {
     Isolate.CleanUp();
 }
 public void CleanupMocks()
 {
     Isolate.CleanUp();
     SharePointServiceLocator.Reset();
 }
Exemplo n.º 9
0
 public void TearDown()
 {
     Isolate.CleanUp();
 }
Exemplo n.º 10
0
 public void SetUp()
 {
     Isolate.CleanUp();
 }
 public void Cleanup()
 {
     Isolate.CleanUp();
     SharePointServiceLocator.ReplaceCurrentServiceLocator(null);
 }
Exemplo n.º 12
0
 public void TestCleanup()
 {
     Isolate.CleanUp();
     SharePointServiceLocator.Reset();
 }
 public void Init()
 {
     Isolate.CleanUp();
 }