public void Ctor_Cookie_Options_AttributeCount(byte[] cookie, DirectorySynchronizationOptions option, int attributeCount, byte[] expectedValue)
        {
            var control = new DirSyncRequestControl(cookie, option, attributeCount);

            Assert.Equal(attributeCount, control.AttributeCount);
            Assert.Equal(cookie ?? Array.Empty <byte>(), control.Cookie);
            Assert.Equal(option, control.Option);

            Assert.True(control.IsCritical);
            Assert.True(control.ServerSide);
            Assert.Equal("1.2.840.113556.1.4.841", control.Type);

            Assert.Equal(expectedValue, control.GetValue());
        }
        public void Ctor_Default()
        {
            var control = new DirSyncRequestControl();

            Assert.Equal(1048576, control.AttributeCount);
            Assert.Empty(control.Cookie);
            Assert.Equal(DirectorySynchronizationOptions.None, control.Option);

            Assert.True(control.IsCritical);
            Assert.True(control.ServerSide);
            Assert.Equal("1.2.840.113556.1.4.841", control.Type);

            var expected = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? 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 };

            Assert.Equal(expected, control.GetValue());
        }
Exemplo n.º 3
0
        public void Ctor_Default()
        {
            var control = new DirSyncRequestControl();

            Assert.Equal(1048576, control.AttributeCount);
            Assert.Empty(control.Cookie);
            Assert.Equal(DirectorySynchronizationOptions.None, control.Option);

            Assert.True(control.IsCritical);
            Assert.True(control.ServerSide);
            Assert.Equal("1.2.840.113556.1.4.841", control.Type);

            Assert.Equal(new byte[] { 48, 132, 0, 0, 0, 10, 2, 1, 0, 2, 3, 16, 0, 0, 4, 0 }, control.GetValue());
        }