本文整理汇总了C#中IUnitTestProvider类的典型用法代码示例。如果您正苦于以下问题:C# IUnitTestProvider类的具体用法?C# IUnitTestProvider怎么用?C# IUnitTestProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUnitTestProvider类属于命名空间,在下文中一共展示了IUnitTestProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContextFactory
public ContextFactory(IUnitTestProvider provider, IProjectModelElement project, string assemblyPath, ContextCache cache)
{
_provider = provider;
_cache = cache;
_project = project;
_assemblyPath = assemblyPath;
}
示例2: TestClassManager
/// <summary>
/// A container type that handles an entire test class throughout the
/// test run.
/// </summary>
/// <param name="filter">Test run filter object.</param>
/// <param name="testHarness">The unit test harness.</param>
/// <param name="testClass">The test class metadata interface.</param>
/// <param name="instance">The object instance.</param>
/// <param name="provider">The unit test provider.</param>
public TestClassManager(TestRunFilter filter, UnitTestHarness testHarness, ITestClass testClass, object instance, IUnitTestProvider provider) : base(testHarness, provider)
{
_filter = filter;
_testClass = testClass;
_testExecutionQueue = new CompositeWorkItem();
_instance = instance;
}
示例3: AssemblyDispatcher
public AssemblyDispatcher(UnitTestHarness testHarness, IUnitTestProvider provider,
IAssembly testAssembly) : base(testHarness, provider)
{
_assembly = testAssembly;
_testClasses = new TestWorkItemDispatcher();
_classInstances = new TestClassInstanceCollection();
}
示例4: TestUnitTestElement
public TestUnitTestElement(IUnitTestProvider provider, GallioTestElement parent, string testId, string testName,
string kind, bool isTestCase, IProject project, IDeclaredElementResolver declaredElementResolver, string assemblyPath,
string typeName, string namespaceName)
: base(provider, parent, testId, testName, kind, isTestCase, project, declaredElementResolver, assemblyPath,
typeName, namespaceName)
{
}
示例5: CreateFromTest
public static GallioTestElement CreateFromTest(TestData test, ICodeElementInfo codeElement, IUnitTestProvider provider,
GallioTestElement parent)
{
if (test == null)
throw new ArgumentNullException("test");
// The idea here is to generate a test element object that does not retain any direct
// references to the code element info and other heavyweight objects. A test element may
// survive in memory for quite a long time so we don't want it holding on to all sorts of
// irrelevant stuff. Basically we flatten out the test to just those properties that we
// need to keep.
var element = new GallioTestElement(provider, parent,
test.Id,
test.Name,
test.Metadata.GetValue(MetadataKeys.TestKind) ?? "Unknown",
test.IsTestCase,
ReSharperReflectionPolicy.GetProject(codeElement),
ReSharperReflectionPolicy.GetDeclaredElementResolver(codeElement),
GetAssemblyPath(codeElement),
GetTypeName(codeElement),
GetNamespaceName(codeElement));
var categories = test.Metadata[MetadataKeys.Category];
if (categories.Count != 0)
element.Categories = UnitTestElementCategory.Create(categories);
var reason = test.Metadata.GetValue(MetadataKeys.IgnoreReason);
if (reason != null)
element.ExplicitReason = reason;
return element;
}
示例6: StorEvilUnitTestElement
protected StorEvilUnitTestElement(IUnitTestProvider provider, UnitTestElement parent, IProject project,
string title)
: base(provider, parent)
{
Project = project;
_title = title;
}
示例7: SilverlightUnitTestElement
public SilverlightUnitTestElement(IUnitTestProvider provider, IUnitTestRunStrategy runStrategy)
{
this.runStrategy = runStrategy;
Id = Guid.NewGuid().ToString();
Provider = provider;
Children = new List<IUnitTestElement>();
}
示例8: RegisterUnitTestProvider
/// <summary>
/// Register another available unit test provider for the unit test system.
/// </summary>
/// <param name="provider">A unit test provider.</param>
public static void RegisterUnitTestProvider(IUnitTestProvider provider)
{
if (!UnitTestProviders.Providers.Contains(provider))
{
UnitTestProviders.Providers.Add(provider);
}
}
示例9: TestMethodManager
/// <summary>
/// Constructor for a test method manager, which handles executing a single test method
/// for a unit test provider.
/// </summary>
/// <param name="testHarness">The unit test harness object.</param>
/// <param name="testClass">The test class metadata object.</param>
/// <param name="testMethod">The test method metadata object.</param>
/// <param name="instance">The test class instance.</param>
/// <param name="provider">The unit test provider.</param>
public TestMethodManager(UnitTestHarness testHarness, ITestClass testClass, ITestMethod testMethod, object instance, IUnitTestProvider provider)
: base(testHarness, provider)
{
_testClass = testClass;
_testMethod = testMethod;
_instance = instance;
}
示例10: FileExplorer
public FileExplorer(IUnitTestProvider provider,
UnitTestElementLocationConsumer consumer,
IFile file,
CheckForInterrupt interrupted)
{
if (file == null)
{
throw new ArgumentNullException("file");
}
if (provider == null)
{
throw new ArgumentNullException("provider");
}
_consumer = consumer;
_file = file;
_interrupted = interrupted;
IProject project = file.ProjectFile.GetProject();
string assemblyPath = UnitTestManager.GetOutputAssemblyPath(project).FullPath;
var contextFactory = new ContextFactory(provider, project, assemblyPath);
var contextSpecificationFactory = new ContextSpecificationFactory(provider, project);
var behaviorFactory = new BehaviorFactory(provider, project);
var behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, project);
_elementHandlers = new List<IElementHandler>
{
new ContextElementHandler(contextFactory),
new ContextSpecificationElementHandler(contextSpecificationFactory),
new BehaviorElementHandler(behaviorFactory, behaviorSpecificationFactory)
};
}
示例11: BaseTestAssembly
public BaseTestAssembly(IUnitTestProvider provider, UnitTestHarness testHarness, Assembly assembly) {
this.provider = provider;
this.testHarness = testHarness;
this.assembly = assembly;
this.init = new LazyAssemblyMethodInfo(this.assembly, typeof(AssemblyInitializeAttribute));
this.cleanup = new LazyAssemblyMethodInfo(this.assembly, typeof(AssemblyCleanupAttribute));
}
示例12: AssemblyManager
/// <summary>
/// Create a new assembly manager, takes in the harness, provider
/// reference and actual IAssembly object.
/// </summary>
/// <param name="runFilter">The test run filter object.</param>
/// <param name="testHarness">Harness object.</param>
/// <param name="provider">The unit test metadata provider.</param>
/// <param name="testAssembly">The test assembly metadata object.</param>
public AssemblyManager(TestRunFilter runFilter, UnitTestHarness testHarness, IUnitTestProvider provider, IAssembly testAssembly) : base(testHarness, provider)
{
_filter = runFilter;
_assembly = testAssembly;
_testClasses = new CompositeWorkItem();
ClassInstances = new TestClassInstanceDictionary();
}
示例13: Element
protected Element(IUnitTestProvider provider,
UnitTestElement parent,
ProjectModelElementEnvoy projectEnvoy,
string declaringTypeName,
bool isIgnored)
: base(provider, parent)
{
if (projectEnvoy == null && !Shell.Instance.IsTestShell)
{
throw new ArgumentNullException("projectEnvoy");
}
if (declaringTypeName == null)
{
throw new ArgumentNullException("declaringTypeName");
}
_projectEnvoy = projectEnvoy;
_declaringTypeName = declaringTypeName;
if (isIgnored)
{
SetExplicit("Ignored");
}
}
示例14: EnsureSilverlightPlatformSupport
public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, ref IUnitTestRun run, IUnitTestProvider provider, ITaskRunnerHostController hostController)
{
foreach (var sequence in run.GetRootTasks().ToArray())
{
ConvertToSilverlightSequenceIfNecessary(sequence, ref run, launch, provider, hostController);
}
}
示例15: XunitTestFakeElement
public XunitTestFakeElement(IUnitTestProvider provider, IProject project, IClrTypeName typeName, string methodName)
{
Provider = provider;
myProject = project;
TypeName = typeName;
myMethodName = methodName;
State = UnitTestElementState.Fake;
}