当前位置: 首页>>代码示例>>C#>>正文


C# Proxy.DeleteAll方法代码示例

本文整理汇总了C#中System.Proxy.DeleteAll方法的典型用法代码示例。如果您正苦于以下问题:C# Proxy.DeleteAll方法的具体用法?C# Proxy.DeleteAll怎么用?C# Proxy.DeleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Proxy的用法示例。


在下文中一共展示了Proxy.DeleteAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DocumentationTests

        public DocumentationTests()
        {
            var processes = System.Diagnostics.Process.GetProcessesByName("Moksy.Host");
            Assert.AreEqual(1, processes.Length, "Moksy.Host is not running. Right click the Moksy.Host project, add 10011 to the Debug / Command Line Arguments and then run Moksy.Host without a debugger. Then try to run this test again. ");

            Proxy = new Proxy(PortNumber);
            Assert.IsTrue(Proxy.Start(), string.Format("Moksy could not start. Try to manually launch 'Moksy.Host.exe {0}' from the Command Line. ", PortNumber));
            Proxy.DeleteAll();
        }
开发者ID:aidancasey,项目名称:Moksy,代码行数:9,代码来源:DocumentationTests.cs

示例2: Initialize

        public void Initialize()
        {
            Proxy = new Proxy(10011);
            Proxy.DeleteAll();

            // Post
            var s = SimulationFactory.When.I.Post().ToImdb("/Pet/{Kind}/Toy/{Name}/Price", "owner").AsJson().And.NotExists("{Ranking}").Then.AddToImdb().And.Return.StatusCode(System.Net.HttpStatusCode.Created);
            Proxy.Add(s);

            s = SimulationFactory.When.I.Post().ToImdb("/Pet/{Kind}/Toy/{Name}/Price", "owner").AsJson().And.Exists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.Conflict);
            Proxy.Add(s);

            // Put
            s = SimulationFactory.When.I.Put().ToImdb("/Pet/{Kind}/Toy/{Name}/Price", "owner").AsJson().And.NotExists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.Created).Then.AddToImdb();
            Proxy.Add(s);

            s = SimulationFactory.When.I.Put().ToImdb("/Pet/{Kind}/Toy/{Name}/Price", "owner").AsJson().And.Exists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.PartialContent).Then.AddToImdb();
            Proxy.Add(s);

            s = SimulationFactory.When.I.Put().ToImdb("/Pet/{Kind}/Toy/{Name}/Price/{Ranking}", "owner").AsJson().And.NotExists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.Unauthorized).Then.AddToImdb();
            Proxy.Add(s);

            s = SimulationFactory.When.I.Put().ToImdb("/Pet/{Kind}/Toy/{Name}/Price/{Ranking}", "owner").AsJson().And.Exists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.UnsupportedMediaType).Then.AddToImdb();
            Proxy.Add(s);

            // GetById
            s = SimulationFactory.When.I.Get().FromImdb("/Pet/{Kind}/Toy/{Name}/Price/{Ranking}", "owner").AsJson().And.Exists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.OK).And.Body("{value}");
            Proxy.Add(s);

            s = SimulationFactory.When.I.Get().FromImdb("/Pet/{Kind}/Toy/{Name}/Price/{Ranking}", "owner").AsJson().And.NotExists("{Ranking}").Then.Return.StatusCode(System.Net.HttpStatusCode.NotFound);
            Proxy.Add(s);

            // Get All
            s = SimulationFactory.When.I.Get().FromImdb("/Pet/{Kind}/Toy/{Name}/Price", "owner").AsJson().Then.Return.StatusCode(System.Net.HttpStatusCode.PaymentRequired).And.Body("[{value}]");
            Proxy.Add(s);
        }
开发者ID:aidancasey,项目名称:Moksy,代码行数:36,代码来源:ImdbNestedTests.cs

示例3: Initialize

        public void Initialize()
        {
            Proxy = new Proxy(10011);
            Proxy.DeleteAll();

            var all = Proxy.GetAll();
            Assert.AreEqual(0, all.Count);
        }
开发者ID:aidancasey,项目名称:Moksy,代码行数:8,代码来源:CrudTests.cs

示例4: Initialize

 public void Initialize()
 {
     Proxy = new Proxy(10011);
     Proxy.DeleteAll();
 }
开发者ID:aidancasey,项目名称:Moksy,代码行数:5,代码来源:BodyParameterMacroTests.cs


注:本文中的System.Proxy.DeleteAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。