Debian Codegraph @

external/corefx/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetAccessControl.cs

raw
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4
5 using System;
6 using Xunit;
7
8 namespace Microsoft.Win32.RegistryTests
9 {
10 public class RegistryKey_GetAccessControl : RegistryTestsBase
11 {
12 [Fact]
13 public void NegativeTests()
14 {
15 // Should throw if RegistryKey is closed
16 Assert.Throws<ObjectDisposedException>(() =>
17 {
18 TestRegistryKey.Close();
19 TestRegistryKey.GetAccessControl();
20 });
21 }
22
23 [Fact]
24 public void GetAccessControlTest()
25 {
26 var registrySecurity = TestRegistryKey.GetAccessControl();
27 Assert.NotNull(registrySecurity);
28 }
29 }
30 }