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


C# IVwSelection.Stub方法代码示例

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


在下文中一共展示了IVwSelection.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
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:32,代码来源:TeStVcTests.cs


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