public void TestBasic() { SetUp(); Assert.False(_feature.IsEnabled); const string Expected = @"expected_remove.config"; var document = XDocument.Load(Current); document.Save(Expected); try { _feature.Enable(); Assert.True(_feature.IsEnabled); XmlAssert.Equal(Expected, Current); _feature.Disable(); Assert.False(_feature.IsEnabled); XmlAssert.Equal(Expected, Current); } catch (Exception ex) { // If not admin, this exception is expected. Assert.IsType <UnauthorizedAccessException>(ex); } }
public void TestDisable() { SetUp(); var site = Path.Combine("Website1", "web.config"); var expected = "expected_edit.site.config"; var document = XDocument.Load(site); document.Save(expected); _feature.Disable(); Assert.False(_feature.IsEnabled); const string Original = @"original.config"; const string OriginalMono = @"original.mono.config"; XmlAssert.Equal(Helper.IsRunningOnMono() ? OriginalMono : Original, Current); XmlAssert.Equal(expected, site); }