• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDemo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IDemo的典型用法代码示例。如果您正苦于以下问题:C# IDemo类的具体用法?C# IDemo怎么用?C# IDemo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDemo类属于命名空间,在下文中一共展示了IDemo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CallbackTests

 public CallbackTests()
 {
     System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
     mocks = new MockRepository();
     demo = (IDemo) mocks.StrictMock(typeof (IDemo));
     callbackCalled = false;
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:7,代码来源:CallbackTests.cs


示例2: CallbackTests

		public CallbackTests()
		{
			System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            demo = MockRepository.Mock<IDemo>();
			callbackCalled = false;
		}
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:7,代码来源:CallbackTests.cs


示例3: CallbackExpectationTests

 public CallbackExpectationTests()
 {
     mocks = new MockRepository();
     demo = (IDemo) mocks.StrictMock(typeof (IDemo));
     method = typeof (IDemo).GetMethod("VoidThreeArgs");
     callbackCalled = false;
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:7,代码来源:CallbackExpectationTests.cs


示例4: CallbackThatThrows

 public void CallbackThatThrows()
 {
     demo = (IDemo) mocks.StrictMock(typeof (IDemo));
     demo.VoidNoArgs();
     LastCall.Callback(new DelegateDefinations.NoArgsDelegate(ThrowFromCallback));
     mocks.ReplayAll();
     demo.VoidNoArgs();
 }
开发者ID:nkmajeti,项目名称:rhino-tools,代码行数:8,代码来源:RhinoMockTests.cs


示例5: CallbackThatThrows

 public void CallbackThatThrows()
 {
     demo = (IDemo)mocks.StrictMock(typeof(IDemo));
     demo.VoidNoArgs();
     LastCall.Callback(new DelegateDefinations.NoArgsDelegate(ThrowFromCallback));
     mocks.ReplayAll();
     Assert.Throws<AddressAlreadyInUseException>(() => demo.VoidNoArgs());
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:8,代码来源:RhinoMockTests.cs


示例6: IMethodRecorderTests

 public IMethodRecorderTests()
 {
     demo = MockRepository.GenerateStrictMock(typeof(IDemo), null, null) as IDemo;
     voidNoArgs = typeof (IDemo).GetMethod("VoidNoArgs");
     voidThreeArgs = typeof (IDemo).GetMethod("VoidThreeStringArgs");
     expectationOne = new AnyArgsExpectation(new FakeInvocation(this.voidNoArgs), new Range(1, 1));
     expectationTwo = new AnyArgsExpectation(new FakeInvocation(voidThreeArgs), new Range(1, 1));
     recorder = CreateRecorder();
     ChildSetup();
 }
开发者ID:alaendle,项目名称:rhino-mocks,代码行数:10,代码来源:IMethodRecorderTests.cs


示例7: AddToMenu

 void AddToMenu(IDemo demo)
 {
     Control control = demo.GetControl();
     FlowMenu.AddMenuItem(new MetroMenuItem(control, MetroMenuTransition.EaseIn, demo.DemoName));
     demo.ChangeDemo += (o, e) =>
     {
         FlowMenu.ShowMenu(e.DemoName);
     };
     RegisterForDragFeedback(control);
 }
开发者ID:bberak,项目名称:PokerDotNet,代码行数:10,代码来源:DemoForm.cs


示例8: CanCreateAStrictMultiMockFromTwoInterfacesCommon

        private static void CanCreateAStrictMultiMockFromTwoInterfacesCommon(IDemo demo)
        {
            demo.Expect(x => x.ReturnIntNoArgs())
                .Return(1);

            IDisposable disposable = demo as IDisposable;
            Assert.NotNull(disposable);

            disposable.Expect(x => x.Dispose());

            Assert.Equal(1, demo.ReturnIntNoArgs());
            disposable.Dispose();

            demo.VerifyAllExpectations();
        }
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:15,代码来源:MultiMocksWithAAA.cs


示例9: openDemoToolStripMenuItem_Click

        private void openDemoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult r = openDemoDialog.ShowDialog();
            if (r == DialogResult.OK)
            {
                demo = Plugin.GetPlugin<IDemo>(openDemoDialog.FileName);

                if (demo == null)
                {
                    MessageBox.Show("Could not find an IDemo in that assembly. :(", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                demo.Init(demoSplit.Panel1.Handle);
                ProgressWindow progressWindow = new ProgressWindow("Loading demo");
                progressWindow.Show(this);
                demo.Load(progressWindow);
                progressWindow.Hide();
            }
        }
开发者ID:weimingtom,项目名称:db-verkstan,代码行数:20,代码来源:Form1.cs


示例10: DefaultController

        public DefaultController(IDemo demo)
        {
            _demo = demo;

            var blah = _demo.Id;
        }
开发者ID:nicholashead,项目名称:ninject-not-disposing-example,代码行数:6,代码来源:DefaultController.cs


示例11: RhinoMockTests

 public RhinoMockTests()
 {
     mocks = new MockRepository();
     demo = this.mocks.StrictMock(typeof(IDemo)) as IDemo;
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:5,代码来源:RhinoMockTests.cs


示例12: RecordOrdered

 private static void RecordOrdered(MockRepository mocks, IDemo demo)
 {
     using (mocks.Ordered())
     {
         demo.ReturnStringNoArgs();
         LastCall.On(demo).Return(null);
         demo.VoidNoArgs();
         LastCall.On(demo).Repeat.Twice();
         demo.VoidStringArg("Hello");
         demo.VoidStringArg("World");
     }
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:12,代码来源:RhinoMockTests.cs


示例13: SteppingFromInnerOrderringToOuterWithoutFullifingAllOrderringInInnerThrows

        public void SteppingFromInnerOrderringToOuterWithoutFullifingAllOrderringInInnerThrows()
        {
            demo = (IDemo)mocks.StrictMock(typeof(IDemo));
            demo.VoidThreeStringArgs("", "", "");
            using (mocks.Ordered())
            {
                demo.VoidNoArgs();
                demo.VoidStringArg("Ayende");
            }
            mocks.Replay(demo);
            demo.VoidNoArgs();

            string expectedMessage = "Unordered method call! The expected call is: 'Ordered: { IDemo.VoidStringArg(\"Ayende\"); }' but was: 'IDemo.VoidThreeStringArgs(\"\", \"\", \"\");'";
            ExpectationViolationException ex = Assert.Throws<ExpectationViolationException>(
                            () => demo.VoidThreeStringArgs("", "", ""));
            Assert.Equal(expectedMessage, ex.Message);
        }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:17,代码来源:RhinoMockTests.cs


示例14: RecursiveExpectationsOnUnordered

 public void RecursiveExpectationsOnUnordered()
 {
     demo = (IDemo)mocks.StrictMock(typeof(IDemo));
     demo.VoidNoArgs();
     LastCall.On(demo).Callback(new DelegateDefinations.NoArgsDelegate(CallMethodOnDemo));
     demo.VoidStringArg("Ayende");
     mocks.Replay(demo);
     demo.VoidNoArgs();
     mocks.Verify(demo);
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:10,代码来源:RhinoMockTests.cs


示例15: RecursiveExpectationsOnOrdered

 public void RecursiveExpectationsOnOrdered()
 {
     demo = (IDemo)mocks.StrictMock(typeof(IDemo));
     using (mocks.Ordered())
     {
         demo.VoidNoArgs();
         LastCall.On(demo).Callback(CallMethodOnDemo);
         demo.VoidStringArg("Ayende");
     }
     mocks.Replay(demo);
     string expectedMessage = "Unordered method call! The expected call is: 'Ordered: { IDemo.VoidNoArgs(callback method: RhinoMockTests.CallMethodOnDemo); }' but was: 'IDemo.VoidStringArg(\"Ayende\");'";
     ExpectationViolationException ex = Assert.Throws<ExpectationViolationException>(
                     () => demo.VoidNoArgs());
     Assert.Equal(expectedMessage, ex.Message);
 }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:15,代码来源:RhinoMockTests.cs


示例16: GetArgsOfEpectedAndActualMethodCallOnException

        public void GetArgsOfEpectedAndActualMethodCallOnException()
        {
            demo = (IDemo)mocks.StrictMock(typeof(IDemo));
            demo.VoidThreeStringArgs("a", "b", "c");
            mocks.Replay(demo);

            string expectedMessage = "IDemo.VoidThreeStringArgs(\"c\", \"b\", \"a\"); Expected #0, Actual #1.\r\nIDemo.VoidThreeStringArgs(\"a\", \"b\", \"c\"); Expected #1, Actual #0.";
            ExpectationViolationException ex = Assert.Throws<ExpectationViolationException>(
                            () => demo.VoidThreeStringArgs("c", "b", "a"));
            Assert.Equal(expectedMessage, ex.Message);
        }
开发者ID:bjornbouetsmith,项目名称:mammock,代码行数:11,代码来源:RhinoMockTests.cs


示例17: MockedObjectsComparerTests

		public MockedObjectsComparerTests()
		{
            one = MockRepository.Mock<IDemo>();
            two = MockRepository.Mock<IDemo>();
		}
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:5,代码来源:MockedObjectsComparerTests.cs


示例18: When_mocking_properties_with_RhinoMocks_stub

 public When_mocking_properties_with_RhinoMocks_stub()
 {
     _demo = MockRepository.GenerateStub<IDemo>();
     SetValuesOnMock();
 }
开发者ID:ChuangYang,项目名称:RhinoMocks,代码行数:5,代码来源:FieldProblem_Nolan2.cs


示例19: SetUp

 public void SetUp()
 {
     mocks = new MockRepository();
     demo = mocks.StrictMock(typeof (IDemo)) as IDemo;
 }
开发者ID:bcraytor,项目名称:rhino-mocks,代码行数:5,代码来源:ExpectTests.cs


示例20: LastCallTests

 public LastCallTests()
 {
     mocks = new MockRepository();
     demo = (IDemo) mocks.StrictMock(typeof (IDemo));
 }
开发者ID:ChuangYang,项目名称:RhinoMocks,代码行数:5,代码来源:LastCallTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDeobfuscator类代码示例发布时间:2022-05-24
下一篇:
C# IDefragmentContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap