public void RemoveWebSiteStatus(string webSiteName)
        {
            var webSiteStatus = RetrieveSyncStatus(webSiteName);

            if (webSiteStatus != null && webSiteStatus.Any())
            {
                _table.Delete(webSiteStatus.Select(s => s.ToRow()));
            }
        }
Esempio n. 2
0
        public void RemoveWebSite(Guid webSiteId)
        {
            string key = webSiteId.ToString();

            var websites = _webSiteTable.Query.Where(ws => ws.RowKey == key);
            var bindings = _bindingTable.Query.Where(b => b.WebSiteId == webSiteId);

            _webSiteTable.Delete(websites);
            _bindingTable.Delete(bindings);
        }
Esempio n. 3
0
 private void CleanupWebsiteTest(ServerManager serverManager)
 {
     // Remove all IIS websites
     serverManager.Sites.Where(s => !_excludedSites.Contains(s.Name)).ToList().ForEach(s => serverManager.Sites.Remove(s));
     serverManager.CommitChanges();
     // Clean table storage
     _webSiteTable.Delete(_webSiteTable.Query.ToList());
     _bindingTable.Delete(_bindingTable.Query.ToList());
     // Clear site and temp directories
     Directory.Delete(_sitePath, true);
     Directory.CreateDirectory(_sitePath);
     Directory.Delete(_tempPath, true);
     Directory.CreateDirectory(_tempPath);
 }
Esempio n. 4
0
        public void Create_and_remove_web_site_with_initial_binding()
        {
            var newsite     = default(WebSiteRow);
            var newbindings = default(IList <BindingRow>);

            try
            {
                var site    = CreateWebSiteWithBindings(1);
                var binding = site.Bindings.First();

                var id  = site.Id.ToString();
                var idb = binding.Id.ToString();

                newsite     = _webSiteTable.Query.Where(t => t.RowKey == id).FirstOrDefault();
                newbindings = _bindingTable.Query.Where(b => b.RowKey == idb).ToList();

                Assert.IsNotNull(newsite);

                _repository.RemoveWebSite(site.Id);

                newsite = _webSiteTable.Query.Where(t => t.RowKey == id).FirstOrDefault();
                Assert.IsNull(newsite);

                newbindings = _bindingTable.Query.Where(b => b.RowKey == idb).ToList();

                Assert.IsNotNull(newbindings);
                Assert.AreEqual(0, newbindings.Count());
            }
            finally
            {
                if (newsite != null)
                {
                    _webSiteTable.Delete(newsite);
                }

                if (newbindings != null && newbindings.Any())
                {
                    _bindingTable.Delete(newbindings);
                }
            }
        }
Esempio n. 5
0
        public void RemoveBinding(Guid bindingId)
        {
            string key = bindingId.ToString();

            _bindingTable.Delete(_bindingTable.Query.Where(b => b.RowKey == key));
        }