Exemplo n.º 1
0
        public static void testCORSConfig()
        {
            CORSConfiguration corsConfig = new CORSConfiguration();

            corsConfig.corsRules = new System.Collections.Generic.List <CORSConfiguration.CORSRule>();
            for (int i = 0; i < 3; i++)
            {
                CORSConfiguration.CORSRule corsRule = new CORSConfiguration.CORSRule();
                corsRule.id             = String.Format("the {0}th", i + 1);
                corsRule.maxAgeSeconds  = 5000;
                corsRule.allowedMethods = new System.Collections.Generic.List <string>();
                corsRule.allowedMethods.Add("PUT");
                corsRule.allowedMethods.Add("DELETE");

                corsRule.allowedHeaders = new System.Collections.Generic.List <string>();
                corsRule.allowedHeaders.Add("Host");
                corsRule.allowedHeaders.Add("Authorization");

                corsRule.exposeHeaders = new System.Collections.Generic.List <string>();
                corsRule.exposeHeaders.Add("X-COS-Meta1");
                corsRule.exposeHeaders.Add("X-COS-Meta2");

                corsConfig.corsRules.Add(corsRule);
            }
            Console.WriteLine(corsConfig.GetInfo());
        }
Exemplo n.º 2
0
        public void GetInfoTest()
        {
            CORSConfiguration target   = new CORSConfiguration(); // TODO: Initialize to an appropriate value
            string            expected = string.Empty;            // TODO: Initialize to an appropriate value
            string            actual;

            actual = target.GetInfo();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
 public override string GetResultInfo()
 {
     return(base.GetResultInfo() + (corsConfiguration == null ? "" : "\n " + corsConfiguration.GetInfo()));
 }