本文整理汇总了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;
}
示例2: CallbackTests
public CallbackTests()
{
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
demo = MockRepository.Mock<IDemo>();
callbackCalled = false;
}
示例3: CallbackExpectationTests
public CallbackExpectationTests()
{
mocks = new MockRepository();
demo = (IDemo) mocks.StrictMock(typeof (IDemo));
method = typeof (IDemo).GetMethod("VoidThreeArgs");
callbackCalled = false;
}
示例4: CallbackThatThrows
public void CallbackThatThrows()
{
demo = (IDemo) mocks.StrictMock(typeof (IDemo));
demo.VoidNoArgs();
LastCall.Callback(new DelegateDefinations.NoArgsDelegate(ThrowFromCallback));
mocks.ReplayAll();
demo.VoidNoArgs();
}
示例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());
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
}
示例10: DefaultController
public DefaultController(IDemo demo)
{
_demo = demo;
var blah = _demo.Id;
}
示例11: RhinoMockTests
public RhinoMockTests()
{
mocks = new MockRepository();
demo = this.mocks.StrictMock(typeof(IDemo)) as IDemo;
}
示例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");
}
}
示例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);
}
示例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);
}
示例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);
}