Debian Codegraph @

external/corefx/src/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetAccessControl_acs.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 System.Security.AccessControl;
7 using Xunit;
8
9 namespace Microsoft.Win32.RegistryTests
10 {
11 public class RegistryKey_GetAccessControl_acs : RegistryTestsBase
12 {
13 [Fact]
14 public void NegativeTests()
15 {
16 // Should throw if RegistryKey is closed
17 Assert.Throws<ObjectDisposedException>(() =>
18 {
19 TestRegistryKey.Close();
20 TestRegistryKey.GetAccessControl(new AccessControlSections());
21 });
22 }
23
24 [Fact]
25 public void GetAccessControlTest()
26 {
27 var registrySecurity = TestRegistryKey.GetAccessControl(new AccessControlSections());
28 Assert.NotNull(registrySecurity);
29 }
30 }
31 }