示例#1
0
        public TestConfig(ITestSite site)
        {
            ContentTransport = (ContentInformationTransport)Enum.Parse(typeof(ContentInformationTransport), site.Properties["ContentTransport"]);

            SupportBranchCacheV1 = bool.Parse(site.Properties["SupportBranchCacheV1"]);
            SupportBranchCacheV2 = bool.Parse(site.Properties["SupportBranchCacheV2"]);

            ContentServerComputerName     = site.Properties["ContentServerComputerName"];
            HostedCacheServerComputerName = site.Properties["HostedCacheServerComputerName"];
            ClientPeerComputerName        = site.Properties["ClientPeerComputerName"];

            DomainName   = site.Properties["DomainName"];
            UserName     = site.Properties["UserName"];
            UserPassword = site.Properties["UserPassword"];

            HashLevelType = (ServerHashLevel)Enum.Parse(typeof(ServerHashLevel), site.Properties["SupportedHashLevel"]);

            SecurityPackageType = (SecurityPackageType)Enum.Parse(typeof(SecurityPackageType), site.Properties["SecurityPackageType"]);

            ServerSecret = Encoding.Unicode.GetBytes(site.Properties["ServerSecret"]);

            Timeout             = TimeSpan.FromSeconds(int.Parse(site.Properties["Timeout"]));
            RetryInterval       = TimeSpan.FromSeconds(int.Parse(site.Properties["RetryInterval"]));
            NegativeTestTimeout = TimeSpan.FromSeconds(int.Parse(site.Properties["NegativeTestTimeout"]));

            SharedFolderName = site.Properties["SharedFolderName"];

            NameOfFileWithMultipleSegments = site.Properties["NameOfFileWithMultipleSegments"];
            NameOfFileWithMultipleBlocks   = site.Properties["NameOfFileWithMultipleBlocks"];
            NameOfFileWithSingleBlock      = site.Properties["NameOfFileWithSingleBlock"];

            WebsiteLocalPath   = site.Properties["WebsiteLocalPath"];
            FileShareLocalPath = site.Properties["FileShareLocalPath"];

            SupportWebsiteForcedHashGeneration   = bool.Parse(site.Properties["SupportWebsiteForcedHashGeneration"]);
            SupportFileShareForcedHashGeneration = bool.Parse(site.Properties["SupportFileShareForcedHashGeneration"]);

            ContentServerHTTPListenPort      = int.Parse(site.Properties["ContentServerHTTPListenPort"]);
            HostedCacheServerHTTPListenPort  = int.Parse(site.Properties["HostedCacheServerHTTPListenPort"]);
            HostedCacheServerHTTPSListenPort = int.Parse(site.Properties["HostedCacheServerHTTPSListenPort"]);
            ClientContentRetrievalListenPort = int.Parse(site.Properties["ClientContentRetrievalListenPort"]);
        }
        public TestConfig(ITestSite site)
        {
            ContentTransport = (ContentInformationTransport)Enum.Parse(typeof(ContentInformationTransport), site.Properties["ContentTransport"]);

            SupportBranchCacheV1 = bool.Parse(site.Properties["SupportBranchCacheV1"]);
            SupportBranchCacheV2 = bool.Parse(site.Properties["SupportBranchCacheV2"]);

            ContentServerComputerName = site.Properties["ContentServerComputerName"];
            HostedCacheServerComputerName = site.Properties["HostedCacheServerComputerName"];
            ClientPeerComputerName = site.Properties["ClientPeerComputerName"];

            DomainName = site.Properties["DomainName"];
            UserName = site.Properties["UserName"];
            UserPassword = site.Properties["UserPassword"];

            HashLevelType = (ServerHashLevel)Enum.Parse(typeof(ServerHashLevel), site.Properties["SupportedHashLevel"]);

            SecurityPackageType = (SecurityPackageType)Enum.Parse(typeof(SecurityPackageType), site.Properties["SecurityPackageType"]);

            ServerSecret = Encoding.Unicode.GetBytes(site.Properties["ServerSecret"]);

            Timeout = TimeSpan.FromSeconds(int.Parse(site.Properties["Timeout"]));
            RetryInterval = TimeSpan.FromSeconds(int.Parse(site.Properties["RetryInterval"]));
            NegativeTestTimeout = TimeSpan.FromSeconds(int.Parse(site.Properties["NegativeTestTimeout"]));

            SharedFolderName = site.Properties["SharedFolderName"];

            NameOfFileWithMultipleSegments = site.Properties["NameOfFileWithMultipleSegments"];
            NameOfFileWithMultipleBlocks = site.Properties["NameOfFileWithMultipleBlocks"];
            NameOfFileWithSingleBlock = site.Properties["NameOfFileWithSingleBlock"];

            WebsiteLocalPath = site.Properties["WebsiteLocalPath"];
            FileShareLocalPath = site.Properties["FileShareLocalPath"];

            SupportWebsiteForcedHashGeneration = bool.Parse(site.Properties["SupportWebsiteForcedHashGeneration"]);
            SupportFileShareForcedHashGeneration = bool.Parse(site.Properties["SupportFileShareForcedHashGeneration"]);

            ContentServerHTTPListenPort = int.Parse(site.Properties["ContentServerHTTPListenPort"]);
            HostedCacheServerHTTPListenPort = int.Parse(site.Properties["HostedCacheServerHTTPListenPort"]);
            HostedCacheServerHTTPSListenPort = int.Parse(site.Properties["HostedCacheServerHTTPSListenPort"]);
            ClientContentRetrievalListenPort = int.Parse(site.Properties["ClientContentRetrievalListenPort"]);
        }