public void TestRevert()
        {
            SetUp();
            var exception = Assert.Throws <InvalidOperationException>(() => _feature.Revert());

            Assert.Equal("Revert operation cannot be done at server level", exception.Message);
        }
        public void TestRevert()
        {
            SetUp();

            const string Expected = @"expected_revert.site.config";
            var          document = XDocument.Load(Current);

            document.Root?.Add(
                new XElement("location",
                             new XAttribute("path", "WebSite1"),
                             new XElement("system.webServer")));
            document.Save(Expected);

            var item = new IsapiFiltersItem(null);

            item.Name = "test";
            item.Path = "c:\\test.dll";
            _feature.AddItem(item);
            Assert.NotNull(_feature.SelectedItem);
            Assert.Equal("test", _feature.SelectedItem.Name);

            _feature.Revert();
            Assert.Null(_feature.SelectedItem);
            Assert.Equal(5, _feature.Items.Count);

            XmlAssert.Equal(Expected, Current);
            XmlAssert.Equal(Path.Combine("Website1", "original.config"), Path.Combine("Website1", "web.config"));
        }
        public async void TestRevert()
        {
            await SetUp();

            var item = new IsapiFiltersItem(null);

            item.Name = "test";
            item.Path = "c:\\test.dll";
            _feature.AddItem(item);
            Assert.NotNull(_feature.SelectedItem);
            Assert.Equal("test", _feature.SelectedItem.Name);

            _feature.Revert();
            Assert.Null(_feature.SelectedItem);
            Assert.Equal(5, _feature.Items.Count);

            const string Expected     = @"expected_revert.site.config";
            const string ExpectedMono = @"expected_revert.site.mono.config";

            XmlAssert.Equal(Path.Combine("IsapiFilters", Helper.IsRunningOnMono() ? ExpectedMono : Expected), Current);
            XmlAssert.Equal(Path.Combine("Website1", "original.config"), Path.Combine("Website1", "web.config"));
        }