Пример #1
0
        public void ServerCompressionAlgorithmTest()
        {
            int errorCode = int.MaxValue;
            RasCompressionType compressionAlgorithm = RasCompressionType.Mppc;
            RasCompressionOptions options = new RasCompressionOptions(NativeMethods.RASCCPO.Encryption128Bit);
            RasCompressionType expected = RasCompressionType.Stac;
            RasCompressionOptions serverOptions = new RasCompressionOptions(NativeMethods.RASCCPO.Encryption40Bit);

            RasCcpInfo target = new RasCcpInfo(errorCode, compressionAlgorithm, options, expected, serverOptions);

            RasCompressionType actual;
            actual = target.ServerCompressionAlgorithm;

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void GetProjectionInfoCcpTest()
        {
            RasCcpInfo expected = new RasCcpInfo(
                0, 
                RasCompressionType.None, 
                new RasCompressionOptions(NativeMethods.RASCCPO.None),
                RasCompressionType.None, 
                new RasCompressionOptions(NativeMethods.RASCCPO.None));

            Mock<IRasHelper> mock = new Mock<IRasHelper>();
            RasHelper.Instance = mock.Object;

            mock.Setup(o => o.GetProjectionInfo(It.IsAny<RasHandle>(), NativeMethods.RASPROJECTION.Ccp)).Returns(expected);

            RasConnection target = new RasConnection();
            RasCcpInfo actual = (RasCcpInfo)target.GetProjectionInfo(RasProjectionType.Ccp);

            Assert.AreSame(expected, actual);
        }
Пример #3
0
        public void RasCcpInfoConstructorTest()
        {
            int errorCode = int.MaxValue;
            RasCompressionType compressionAlgorithm = RasCompressionType.Mppc;
            RasCompressionOptions options = new RasCompressionOptions(NativeMethods.RASCCPO.Encryption128Bit);
            RasCompressionType serverCompressionAlgorithm = RasCompressionType.Stac;
            RasCompressionOptions serverOptions = new RasCompressionOptions(NativeMethods.RASCCPO.Encryption40Bit);

            RasCcpInfo target = new RasCcpInfo(errorCode, compressionAlgorithm, options, serverCompressionAlgorithm, serverOptions);

            Assert.IsNotNull(target);
        }