77
88namespace System . DirectoryServices . Protocols . Tests
99{
10+ [ ConditionalClass ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsOpenSUSE ) ) ]
1011 public class DirSyncRequestControlTests
1112 {
12- public static bool RunningOnWindows => Environment . OSVersion . Platform == PlatformID . Win32NT ;
13-
1413 [ Fact ]
1514 public void Ctor_Default ( )
1615 {
@@ -23,15 +22,15 @@ public void Ctor_Default()
2322 Assert . True ( control . ServerSide ) ;
2423 Assert . Equal ( "1.2.840.113556.1.4.841" , control . Type ) ;
2524
26- var expected = ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } ;
25+ var expected = ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } ;
2726 Assert . Equal ( expected , control . GetValue ( ) ) ;
2827 }
2928
3029 public static IEnumerable < object [ ] > Ctor_Cookie_Data ( )
3130 {
32- yield return new object [ ] { null , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
33- yield return new object [ ] { new byte [ 0 ] , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
34- yield return new object [ ] { new byte [ ] { 97 , 98 , 99 } , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 13 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } : new byte [ ] { 48 , 13 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } } ;
31+ yield return new object [ ] { null , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
32+ yield return new object [ ] { new byte [ 0 ] , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
33+ yield return new object [ ] { new byte [ ] { 97 , 98 , 99 } , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 13 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } : new byte [ ] { 48 , 13 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } } ;
3534 }
3635
3736 [ Theory ]
@@ -52,9 +51,9 @@ public void Ctor_Cookie(byte[] cookie, byte[] expectedValue)
5251
5352 public static IEnumerable < object [ ] > Ctor_Cookie_Options_Data ( )
5453 {
55- yield return new object [ ] { null , DirectorySynchronizationOptions . None , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
56- yield return new object [ ] { new byte [ 0 ] , DirectorySynchronizationOptions . None - 1 , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 13 , 2 , 4 , 255 , 255 , 255 , 255 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 255 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
57- yield return new object [ ] { new byte [ ] { 97 , 98 , 99 } , DirectorySynchronizationOptions . ObjectSecurity , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 13 , 2 , 1 , 1 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } : new byte [ ] { 48 , 13 , 2 , 1 , 1 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } } ;
54+ yield return new object [ ] { null , DirectorySynchronizationOptions . None , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
55+ yield return new object [ ] { new byte [ 0 ] , DirectorySynchronizationOptions . None - 1 , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 13 , 2 , 4 , 255 , 255 , 255 , 255 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 255 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
56+ yield return new object [ ] { new byte [ ] { 97 , 98 , 99 } , DirectorySynchronizationOptions . ObjectSecurity , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 13 , 2 , 1 , 1 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } : new byte [ ] { 48 , 13 , 2 , 1 , 1 , 2 , 3 , 16 , 0 , 0 , 4 , 3 , 97 , 98 , 99 } } ;
5857 }
5958
6059 [ Theory ]
@@ -75,9 +74,9 @@ public void Ctor_Cookie_Options(byte[] cookie, DirectorySynchronizationOptions o
7574
7675 public static IEnumerable < object [ ] > Ctor_Cookie_Options_AttributeCount_Data ( )
7776 {
78- yield return new object [ ] { null , DirectorySynchronizationOptions . None , 1048576 , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
79- yield return new object [ ] { new byte [ 0 ] , DirectorySynchronizationOptions . None - 1 , 0 , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 11 , 2 , 4 , 255 , 255 , 255 , 255 , 2 , 1 , 0 , 4 , 0 } : new byte [ ] { 48 , 8 , 2 , 1 , 255 , 2 , 1 , 0 , 4 , 0 } } ;
80- yield return new object [ ] { new byte [ ] { 97 , 98 , 99 } , DirectorySynchronizationOptions . ObjectSecurity , 10 , ( RunningOnWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 11 , 2 , 1 , 1 , 2 , 1 , 10 , 4 , 3 , 97 , 98 , 99 } : new byte [ ] { 48 , 11 , 2 , 1 , 1 , 2 , 1 , 10 , 4 , 3 , 97 , 98 , 99 } } ;
77+ yield return new object [ ] { null , DirectorySynchronizationOptions . None , 1048576 , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } : new byte [ ] { 48 , 10 , 2 , 1 , 0 , 2 , 3 , 16 , 0 , 0 , 4 , 0 } } ;
78+ yield return new object [ ] { new byte [ 0 ] , DirectorySynchronizationOptions . None - 1 , 0 , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 11 , 2 , 4 , 255 , 255 , 255 , 255 , 2 , 1 , 0 , 4 , 0 } : new byte [ ] { 48 , 8 , 2 , 1 , 255 , 2 , 1 , 0 , 4 , 0 } } ;
79+ yield return new object [ ] { new byte [ ] { 97 , 98 , 99 } , DirectorySynchronizationOptions . ObjectSecurity , 10 , ( PlatformDetection . IsWindows ) ? new byte [ ] { 48 , 132 , 0 , 0 , 0 , 11 , 2 , 1 , 1 , 2 , 1 , 10 , 4 , 3 , 97 , 98 , 99 } : new byte [ ] { 48 , 11 , 2 , 1 , 1 , 2 , 1 , 10 , 4 , 3 , 97 , 98 , 99 } } ;
8180 }
8281
8382 [ Theory ]
0 commit comments