コード例 #1
0
 public PingWebTestConfiguration(string url, int? expectedHttpStatusCode = 200)
 {
     _webTest = new DeclarativeWebTest { Proxy = "default" };
     var webTestRequest = new WebTestRequest(url)
     {
         ExpectedHttpStatusCode = expectedHttpStatusCode == null ? 0 : expectedHttpStatusCode.Value,
         IgnoreHttpStatusCode = expectedHttpStatusCode == null
     };
     _webTest.Items.Add(webTestRequest);
 }
コード例 #2
0
ファイル: WebTestExtensions.cs プロジェクト: cnq/insights-poc
        public static string ToXml(this DeclarativeWebTest webTest)
        {
            string xml;

            using (var stream = new MemoryStream())
                using (var reader = new StreamReader(stream))
                {
                    DeclarativeWebTestSerializer.Save(webTest, stream);
                    stream.Position = 0;
                    xml             = reader.ReadToEnd();
                }
            return(xml);
        }
コード例 #3
0
        public PingWebTestConfiguration(string url, int?expectedHttpStatusCode = 200)
        {
            _webTest = new DeclarativeWebTest {
                Proxy = "default"
            };
            var webTestRequest = new WebTestRequest(url)
            {
                ExpectedHttpStatusCode = expectedHttpStatusCode == null ? 0 : expectedHttpStatusCode.Value,
                IgnoreHttpStatusCode   = expectedHttpStatusCode == null
            };

            _webTest.Items.Add(webTestRequest);
        }