コード例 #1
0
        public void Ctor_ServerName_Flag(string serverName, int flag, byte[] expectedValue)
        {
            var control = new VerifyNameControl(serverName, flag);

            Assert.True(control.IsCritical);
            Assert.Equal(flag, control.Flag);
            Assert.Equal(serverName, control.ServerName);
            Assert.True(control.ServerSide);
            Assert.Equal("1.2.840.113556.1.4.1338", control.Type);

            Assert.Equal(expectedValue, control.GetValue());
        }
コード例 #2
0
        public void Ctor_Default()
        {
            var control = new VerifyNameControl();

            Assert.True(control.IsCritical);
            Assert.Equal(0, control.Flag);
            Assert.Null(control.ServerName);
            Assert.True(control.ServerSide);
            Assert.Equal("1.2.840.113556.1.4.1338", control.Type);

            Assert.Equal(new byte[] { 48, 132, 0, 0, 0, 5, 2, 1, 0, 4, 0 }, control.GetValue());
        }
コード例 #3
0
        public void Ctor_Default()
        {
            var control = new VerifyNameControl();

            Assert.True(control.IsCritical);
            Assert.Equal(0, control.Flag);
            Assert.Null(control.ServerName);
            Assert.True(control.ServerSide);
            Assert.Equal("1.2.840.113556.1.4.1338", control.Type);

            var expected = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) ? new byte[] { 48, 132, 0, 0, 0, 5, 2, 1, 0, 4, 0 } : new byte[] { 48, 5, 2, 1, 0, 4, 0 };

            Assert.Equal(expected, control.GetValue());
        }