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


C# IDemo类代码示例

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


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


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