public void TestEdit() { SetUp(); var site = Path.Combine("Website1", "web.config"); var expected = "expected_edit1.site.config"; var document = XDocument.Load(site); var node = document.Root.XPathSelectElement("/configuration/system.webServer"); var directory = new XElement("directoryBrowse"); directory.SetAttributeValue("enabled", "true"); directory.SetAttributeValue("showFlags", "LongDate"); node?.Add(directory); document.Save(expected); _feature.IsEnabled = true; _feature.DateEnabled = _feature.ExtensionEnabled = _feature.SizeEnabled = _feature.TimeEnabled = false; _feature.LongDateEnabled = true; _feature.ApplyChanges(); const string Original = @"original.config"; const string OriginalMono = @"original.mono.config"; XmlAssert.Equal(Helper.IsRunningOnMono() ? OriginalMono : Original, Current); XmlAssert.Equal(expected, site); }
public async void TestEdit() { await this.SetUp(); const string Expected = @"expected_edit.config"; const string ExpectedMono = @"expected_edit.mono.config"; _feature.IsEnabled = true; _feature.DateEnabled = _feature.ExtensionEnabled = _feature.SizeEnabled = _feature.TimeEnabled = false; _feature.ApplyChanges(); XmlAssert.Equal( Helper.IsRunningOnMono() ? Path.Combine("DirectoryBrowse", ExpectedMono) : Path.Combine("DirectoryBrowse", Expected), Current); }
public async void TestEdit() { await this.SetUp(); _feature.IsEnabled = true; _feature.DateEnabled = _feature.ExtensionEnabled = _feature.SizeEnabled = _feature.TimeEnabled = false; _feature.LongDateEnabled = true; _feature.ApplyChanges(); const string Original = @"original.config"; const string OriginalMono = @"original.mono.config"; XmlAssert.Equal(Helper.IsRunningOnMono() ? OriginalMono : Original, Current); XmlAssert.Equal( Path.Combine("DirectoryBrowse", "expected_edit1.site.config"), Path.Combine("Website1", "web.config")); }
public void TestEdit() { SetUp(); const string Expected = @"expected_edit.config"; var document = XDocument.Load(Current); var node = document.Root.XPathSelectElement("/configuration/system.webServer"); var directory = new XElement("directoryBrowse"); directory.SetAttributeValue("enabled", "true"); directory.SetAttributeValue("showFlags", "None"); node?.Add(directory); document.Save(Expected); _feature.IsEnabled = true; _feature.DateEnabled = _feature.ExtensionEnabled = _feature.SizeEnabled = _feature.TimeEnabled = false; _feature.ApplyChanges(); XmlAssert.Equal(Expected, Current); }