public void Ctor_Flags(SecurityMasks masks, byte[] expectedValue) { var control = new SecurityDescriptorFlagControl(masks); Assert.True(control.IsCritical); Assert.Equal(masks, control.SecurityMasks); Assert.True(control.ServerSide); Assert.Equal("1.2.840.113556.1.4.801", control.Type); Assert.Equal(expectedValue, control.GetValue()); }
public void Ctor_Default() { var control = new SecurityDescriptorFlagControl(); Assert.True(control.IsCritical); Assert.Equal(SecurityMasks.None, control.SecurityMasks); Assert.True(control.ServerSide); Assert.Equal("1.2.840.113556.1.4.801", control.Type); Assert.Equal(new byte[] { 48, 132, 0, 0, 0, 3, 2, 1, 0 }, control.GetValue()); }
public void Ctor_Default() { var control = new SecurityDescriptorFlagControl(); Assert.True(control.IsCritical); Assert.Equal(SecurityMasks.None, control.SecurityMasks); Assert.True(control.ServerSide); Assert.Equal("1.2.840.113556.1.4.801", control.Type); var expected = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? new byte[] { 48, 132, 0, 0, 0, 3, 2, 1, 0 } : new byte[] { 48, 3, 2, 1, 0 }; Assert.Equal(expected, control.GetValue()); }