本文整理汇总了C#中IFileSystem.GetTypeFrom方法的典型用法代码示例。如果您正苦于以下问题:C# IFileSystem.GetTypeFrom方法的具体用法?C# IFileSystem.GetTypeFrom怎么用?C# IFileSystem.GetTypeFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem.GetTypeFrom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FakeItEasyMockFactory
/// <summary>
/// Initializes a new instance of the <see cref="FakeItEasyMockFactory"/> class.
/// </summary>
/// <param name="fileSystem">The file system.</param>
/// <exception cref="System.InvalidOperationException">Unable to find Type FakeItEasy.A in assembly + assembly.Location</exception>
public FakeItEasyMockFactory(IFileSystem fileSystem)
{
var assembly = fileSystem.Load("FakeItEasy");
_mockOpenType = fileSystem.GetTypeFrom(assembly, "FakeItEasy.A");
if (_mockOpenType == null)
throw new InvalidOperationException("Unable to find Type FakeItEasy.A in assembly " + assembly.Location);
}
示例2: NSubstituteMockFactory
/// <summary>
/// Initializes a new instance of the <see cref="NSubstituteMockFactory"/> class.
/// </summary>
/// <param name="fileSystem">The file system wrapper.</param>
/// <exception cref="System.InvalidOperationException">Unable to find Type NSubstitute.Substitute in assembly + assembly.Location</exception>
public NSubstituteMockFactory(IFileSystem fileSystem)
{
var assembly = fileSystem.Load("NSubstitute");
_mockOpenType = fileSystem.GetTypeFrom(assembly, "NSubstitute.Substitute");
if (_mockOpenType == null)
throw new InvalidOperationException("Unable to find Type NSubstitute.Substitute in assembly " + assembly.Location);
}