public async void TestAddGlobal() { await this.SetUp(); const string Expected = @"expected_addglobal.config"; Assert.Equal(37, _feature.GlobalModules.Count); var item = new GlobalModule(null); item.Name = "test"; item.Image = "test"; _feature.AddGlobal(item); Assert.Equal(38, _feature.GlobalModules.Count); XmlAssert.Equal(Path.Combine("Modules", Expected), Current); }
public void TestAddGlobal() { SetUp(); const string Expected = @"expected_addglobal.config"; var document = XDocument.Load(Current); var node = document.Root?.XPathSelectElement("/configuration/system.webServer/globalModules"); node?.Add( new XElement("add", new XAttribute("name", "test"), new XAttribute("image", "test"))); document.Save(Expected); Assert.Equal(37, _feature.GlobalModules.Count); var item = new GlobalModule(null); item.Name = "test"; item.Image = "test"; _feature.AddGlobal(item); Assert.Equal(38, _feature.GlobalModules.Count); XmlAssert.Equal(Expected, Current); }