本文整理汇总了C#中IVwRootBox.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IVwRootBox.Stub方法的具体用法?C# IVwRootBox.Stub怎么用?C# IVwRootBox.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwRootBox
的用法示例。
在下文中一共展示了IVwRootBox.Stub方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUpResultsForUpdateUserPromptTests
/// ------------------------------------------------------------------------------------
/// <summary>
/// Sets up results for user prompt change tests (mostly creates and sets up mock
/// objects to stub out methods).
/// </summary>
/// <param name="cLevels">The count of selection levels.</param>
/// <param name="text">The text that was typed or pasted to replace the prompt.</param>
/// <param name="rootb">The (mocked) root box.</param>
/// <param name="vwsel">The (mocked) vw selection.</param>
/// <param name="rootsite">The (mocked) rootsite.</param>
/// ------------------------------------------------------------------------------------
private static void SetUpResultsForUpdateUserPromptTests(int cLevels, string text,
out IVwRootBox rootb, out IVwSelection vwsel, out IVwRootSite rootsite)
{
Options.ShowEmptyParagraphPromptsSetting = true;
IVwRootBox rootbox = rootb = MockRepository.GenerateMock<IVwRootBox>();
rootb.Stub(x => x.IsCompositionInProgress).Return(false);
rootsite = MockRepository.GenerateMock<IVwRootSite>();
rootb.Stub(x => x.Site).Return(rootsite);
vwsel = MockRepository.GenerateMock<IVwSelection>();
vwsel.Stub(x => x.RootBox).Return(rootb);
// The number of levels CLevels reports includes one for the string property, so we add that here (production code subtracts it)
vwsel.Stub(x => x.CLevels(Arg<bool>.Is.Anything)).Return(cLevels + 1);
vwsel.Stub(x => x.AllTextSelInfo(out Arg<int>.Out(0).Dummy, Arg<int>.Is.Equal(cLevels),
Arg<ArrayPtr>.Is.Anything, out Arg<int>.Out(0).Dummy, out Arg<int>.Out(0).Dummy,
out Arg<int>.Out(0).Dummy, out Arg<int>.Out(text.Length).Dummy, out Arg<int>.Out(0).Dummy,
out Arg<bool>.Out(false).Dummy, out Arg<int>.Out(0).Dummy,
out Arg<ITsTextProps>.Out(null).Dummy));
#if DEBUG
vwsel.Stub(x => x.IsValid).Return(true);
#endif
}