本文整理汇总了C#中Machine.Specifications.Runner.ContextInfo类的典型用法代码示例。如果您正苦于以下问题:C# ContextInfo类的具体用法?C# ContextInfo怎么用?C# ContextInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContextInfo类属于Machine.Specifications.Runner命名空间,在下文中一共展示了ContextInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectReportingInformationRunListener
public CollectReportingInformationRunListener()
{
_currentAssemblyName = "";
_currentContext = null;
_contextsByAssembly = new Dictionary<string, List<ContextInfo>>();
_specificationsByContext = new Dictionary<ContextInfo, List<SpecificationInfo>>();
_resultsBySpecification = new Dictionary<SpecificationInfo, Result>();
}
示例2: OnContextEnd
public void OnContextEnd(ContextInfo context)
{
if (!_concernsToContexts.ContainsKey(context.Concern))
{
_concernsToContexts[context.Concern] = new List<Context>();
}
_concernsToContexts[context.Concern].Add(context.ToNode(_specifications));
}
示例3: GetContextTime
public long GetContextTime(ContextInfo contextInfo)
{
if (_contextTimes.ContainsKey(contextInfo))
{
return _contextTimes[contextInfo];
}
return -1;
}
示例4: OnContextStart
public void OnContextStart(ContextInfo context)
{
_specifications = 0;
_errors = 0;
_successes = 0;
var notify = CreateTaskNotificationFor(context);
notify(task => _server.TaskStarting(task));
}
示例5: RecordFailure
public void RecordFailure(ContextInfo context, SpecificationInfo specification, Result result)
{
if (!_failures.ContainsKey(context))
{
_failures.Add(context, new List<FailedSpecification>());
}
var entry = _failures[context];
entry.Add(new FailedSpecification {Specification = specification, Result = result});
}
示例6: OnContextStart
public void OnContextStart(ContextInfo context)
{
_specifications = 0;
_errors = 0;
_successes = 0;
// TODO: This sucks, but there's no better way unless we make behaviors first-class citizens.
_currentContext = context;
var notify = CreateTaskNotificationFor(context, context);
notify(task => _server.TaskStarting(task));
}
示例7: Matches
public override bool Matches(object infoFromRunner, ContextInfo maybeContext)
{
var context = infoFromRunner as ContextInfo;
if (context == null)
{
return false;
}
return ContainingType == context.TypeName;
}
示例8: Matches
public override bool Matches(object infoFromRunner, ContextInfo maybeContext)
{
var specification = infoFromRunner as SpecificationInfo;
if (specification == null)
{
return false;
}
return ContainingType == specification.ContainingType &&
FieldName == specification.FieldName;
}
开发者ID:AnthonyMastrean,项目名称:machine.specifications,代码行数:12,代码来源:ContextSpecificationRemoteTaskNotification.cs
示例9: AddContextToOrganizedCollectionByConcern
public static void AddContextToOrganizedCollectionByConcern(ContextInfo context, Dictionary<string, List<ContextInfo>> organized)
{
if (context.Concern == null)
{
organized[noContextKey].Add(context);
return;
}
if(!organized.ContainsKey(context.Concern))
organized.Add(context.Concern, new List<ContextInfo>());
organized[context.Concern].Add(context);
}
示例10: OnContextStart
public void OnContextStart(ContextInfo context)
{
if (context.Namespace != _currentNamespace)
{
if (!string.IsNullOrEmpty(_currentNamespace))
{
_writer.WriteTestSuiteFinished(_currentNamespace);
}
_currentNamespace = context.Namespace;
_writer.WriteTestSuiteStarted(_currentNamespace);
}
_currentContext = context.FullName;
}
示例11: Before_each_spec
protected override void Before_each_spec()
{
_contextInfo = new ContextInfo("Context", "Concern", "TypeName", "Namespace", "AssemblyName");
PropertyDictionary propertyDictionary = Mocks.Stub<PropertyDictionary>((Project) null);
_task = Mocks.DynamicMock<Task>();
SetupResult.For(_task.Properties).Return(propertyDictionary);
Mocks.Replay(_task);
_sut = new NAntRunListener(_task);
}
开发者ID:stephen-czetty,项目名称:nant-extensions,代码行数:13,代码来源:When_the_NAnt_listener_monitors_context_ends.cs
示例12: OnContextEnd
public void OnContextEnd(ContextInfo context)
{
var result = TaskResult.Inconclusive;
if (_specifications == _successes)
{
result = TaskResult.Success;
}
if (_errors > 0)
{
result = TaskResult.Error;
}
var notify = CreateTaskNotificationFor(context);
notify(task => _server.TaskFinished(task, null, result));
}
示例13: Matches
public override bool Matches(object infoFromRunner, ContextInfo maybeContext)
{
if (maybeContext == null)
{
return false;
}
var specification = infoFromRunner as SpecificationInfo;
if (specification == null)
{
return false;
}
return ContextTypeName == maybeContext.TypeName &&
ContainingType == new NormalizedTypeName(specification.ContainingType) &&
FieldName == specification.FieldName;
}
开发者ID:AnthonyMastrean,项目名称:machine.specifications,代码行数:17,代码来源:BehaviorSpecificationRemoteTaskNotification.cs
示例14: OnContextEnd
public void OnContextEnd(ContextInfo context)
{
_server.TaskProgress(_contextTask, null);
}
示例15: CreateTaskNotificationFor
Action<Action<RemoteTask>> CreateTaskNotificationFor(object infoFromRunner, ContextInfo maybeContext)
{
return actionToBePerformedForEachTask =>
{
bool invoked = false;
foreach (var notification in _taskNotifications)
{
if (notification.Matches(infoFromRunner, maybeContext))
{
Debug.WriteLine(String.Format("Invoking notification for {0}", notification.ToString()));
invoked = true;
foreach (var task in notification.RemoteTasks)
{
actionToBePerformedForEachTask(task);
}
}
}
if (!invoked)
{
Debug.WriteLine(String.Format("No matching notification for {0} received by the runner",
infoFromRunner.ToString()));
}
};
}