public void ContextId_Set_GetReturnsExpected()
        {
            byte[] contextId = new byte[] { 1, 2, 3 };
            var    control   = new VlvRequestControl {
                ContextId = contextId
            };

            Assert.NotSame(contextId, control.ContextId);
            Assert.Equal(contextId, control.ContextId);

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

            Assert.Equal(expected, control.GetValue());
        }
        public void Ctor_BeforeCount_AfterCount_Offset(int beforeCount, int afterCount, int offset, byte[] expectedValue)
        {
            var control = new VlvRequestControl(beforeCount, afterCount, offset);

            Assert.Equal(afterCount, control.AfterCount);
            Assert.Equal(beforeCount, control.BeforeCount);
            Assert.True(control.IsCritical);
            Assert.Equal(offset, control.Offset);
            Assert.Equal(0, control.EstimateCount);
            Assert.Empty(control.Target);
            Assert.Empty(control.ContextId);
            Assert.True(control.ServerSide);
            Assert.Equal("2.16.840.1.113730.3.4.9", control.Type);

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

            Assert.Equal(0, control.AfterCount);
            Assert.Equal(0, control.BeforeCount);
            Assert.True(control.IsCritical);
            Assert.Equal(0, control.Offset);
            Assert.Equal(0, control.EstimateCount);
            Assert.Empty(control.Target);
            Assert.Empty(control.ContextId);
            Assert.True(control.ServerSide);
            Assert.Equal("2.16.840.1.113730.3.4.9", control.Type);

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

            Assert.Equal(expected, control.GetValue());
        }
示例#4
0
        public void ContextId_Set_GetReturnsExpected()
        {
            byte[] contextId = new byte[] { 1, 2, 3 };
            var    control   = new VlvRequestControl {
                ContextId = contextId
            };

            Assert.NotSame(contextId, control.ContextId);
            Assert.Equal(contextId, control.ContextId);

            Assert.Equal(new byte[] { 48, 132, 0, 0, 0, 23, 2, 1, 0, 2, 1, 0, 160, 132, 0, 0, 0, 6, 2, 1, 0, 2, 1, 0, 4, 3, 1, 2, 3 }, control.GetValue());
        }
示例#5
0
        public void Ctor_Default()
        {
            var control = new VlvRequestControl();

            Assert.Equal(0, control.AfterCount);
            Assert.Equal(0, control.BeforeCount);
            Assert.True(control.IsCritical);
            Assert.Equal(0, control.Offset);
            Assert.Equal(0, control.EstimateCount);
            Assert.Empty(control.Target);
            Assert.Empty(control.ContextId);
            Assert.True(control.ServerSide);
            Assert.Equal("2.16.840.1.113730.3.4.9", control.Type);

            Assert.Equal(new byte[] { 48, 132, 0, 0, 0, 18, 2, 1, 0, 2, 1, 0, 160, 132, 0, 0, 0, 6, 2, 1, 0, 2, 1, 0 }, control.GetValue());
        }