本文整理汇总了C#中IMessageSink类的典型用法代码示例。如果您正苦于以下问题:C# IMessageSink类的具体用法?C# IMessageSink怎么用?C# IMessageSink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMessageSink类属于命名空间,在下文中一共展示了IMessageSink类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: XunitTestAssemblyRunnerWithAssemblyFixture
public XunitTestAssemblyRunnerWithAssemblyFixture(ITestAssembly testAssembly,
IEnumerable<IXunitTestCase> testCases,
IMessageSink diagnosticMessageSink,
IMessageSink executionMessageSink,
ITestFrameworkExecutionOptions executionOptions)
: base(testAssembly, testCases, diagnosticMessageSink, executionMessageSink, executionOptions)
{ }
开发者ID:DemoCnblogs,项目名称:xUnit.Net,代码行数:7,代码来源:XunitTestAssemblyRunnerWithAssemblyFixture.cs
示例2: concat_id
public static LNode concat_id(LNode node, IMessageSink sink)
{
var args = node.Args;
if (args.Count == 0)
return null;
if (args.Slice(0, args.Count - 1).Any(n => n.IsCall))
return Reject(sink, node, "All arguments to ##() or concat() must be identifiers or literals (except the last one)");
RVList<LNode> attrs = node.Attrs;
LNode arg = null;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < args.Count; i++)
{
arg = args[i];
attrs.AddRange(arg.Attrs);
if (arg.IsLiteral)
sb.Append(arg.Value ?? "null");
else if (arg.IsId)
sb.Append(arg.Name);
else { // call
if (i + 1 != args.Count || !arg.HasSimpleHead())
return Reject(sink, arg, "Expected simple identifier or literal");
sb.Append(arg.Name);
}
}
Symbol combined = GSymbol.Get(sb.ToString());
LNode result;
if (arg.IsCall)
result = arg.WithTarget(combined);
else
result = LNode.Id(combined, node);
return result.WithAttrs(attrs);
}
开发者ID:BingjieGao,项目名称:Loyc,代码行数:34,代码来源:StandardMacros.cs
示例3: GetTestFrameworkType
static Type GetTestFrameworkType(IAssemblyInfo testAssembly, IMessageSink diagnosticMessageSink)
{
try
{
var testFrameworkAttr = testAssembly.GetCustomAttributes(typeof(ITestFrameworkAttribute)).FirstOrDefault();
if (testFrameworkAttr != null)
{
var discovererAttr = testFrameworkAttr.GetCustomAttributes(typeof(TestFrameworkDiscovererAttribute)).FirstOrDefault();
if (discovererAttr != null)
{
var discoverer = ExtensibilityPointFactory.GetTestFrameworkTypeDiscoverer(diagnosticMessageSink, discovererAttr);
if (discoverer != null)
return discoverer.GetTestFrameworkType(testFrameworkAttr);
var ctorArgs = discovererAttr.GetConstructorArguments().ToArray();
diagnosticMessageSink.OnMessage(new DiagnosticMessage($"Unable to create custom test framework discoverer type '{ctorArgs[1]}, {ctorArgs[0]}'"));
}
else
{
diagnosticMessageSink.OnMessage(new DiagnosticMessage("Assembly-level test framework attribute was not decorated with [TestFrameworkDiscoverer]"));
}
}
}
catch (Exception ex)
{
diagnosticMessageSink.OnMessage(new DiagnosticMessage($"Exception thrown during test framework discoverer construction: {ex.Unwrap()}"));
}
return typeof(XunitTestFramework);
}
开发者ID:modai888,项目名称:xunit,代码行数:30,代码来源:TestFrameworkProxy.cs
示例4: MessageBus
/// <summary/>
public MessageBus(IMessageSink messageSink)
{
this.messageSink = messageSink;
reporterThread = new Thread(ReporterWorker);
reporterThread.Start();
}
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:8,代码来源:MessageBus.cs
示例5: AsyncProcessMessage
public virtual IMessageCtrl AsyncProcessMessage(IMessage reqMsg, IMessageSink replySink)
{
WorkItem work = new WorkItem(reqMsg, this._nextSink, replySink);
work.SetAsync();
this._property.HandleWorkRequest(work);
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:SynchronizedServerContextSink.cs
示例6: RemoteToInternalSpecificationRunListenerAdapter
protected RemoteToInternalSpecificationRunListenerAdapter(object listener, string runOptionsXml)
{
_listener = (IMessageSink)listener;
this.RunOptions = RunOptions.Parse(runOptionsXml);
this.Runner = new DefaultRunner(this, RunOptions);
}
开发者ID:yonglehou,项目名称:machine.specifications,代码行数:7,代码来源:RemoteRunListenerDecorator.cs
示例7: Xunit2Discoverer
// Used by Xunit2 when initializing for both discovery and execution.
internal Xunit2Discoverer(ISourceInformationProvider sourceInformationProvider,
string assemblyFileName,
string configFileName,
bool shadowCopy,
string shadowCopyFolder = null,
IMessageSink diagnosticMessageSink = null)
: this(sourceInformationProvider, null, assemblyFileName, GetXunitExecutionAssemblyPath(assemblyFileName), configFileName, shadowCopy, shadowCopyFolder, diagnosticMessageSink) { }
开发者ID:remcomulder,项目名称:xunit,代码行数:8,代码来源:Xunit2Discoverer.cs
示例8: Run
/// <inheritdoc/>
public void Run(IEnumerable<ITestCase> testMethods, IMessageSink messageSink)
{
bool cancelled = false;
var totalSummary = new RunSummary();
string currentDirectory = Directory.GetCurrentDirectory();
try
{
Directory.SetCurrentDirectory(Path.GetDirectoryName(assemblyInfo.AssemblyPath));
if (messageSink.OnMessage(new TestAssemblyStarting()))
{
var classGroups = testMethods.Cast<XunitTestCase>().GroupBy(tc => tc.Class).ToList();
if (classGroups.Count > 0)
{
var collectionSummary = new RunSummary();
if (messageSink.OnMessage(new TestCollectionStarting()))
{
foreach (var group in classGroups)
{
var classSummary = new RunSummary();
if (!messageSink.OnMessage(new TestClassStarting { ClassName = group.Key.Name }))
cancelled = true;
else
{
cancelled = RunTestClass(messageSink, group, classSummary);
collectionSummary.Aggregate(classSummary);
}
if (!messageSink.OnMessage(new TestClassFinished { Assembly = assemblyInfo, ClassName = group.Key.Name, TestsRun = classSummary.Total }))
cancelled = true;
if (cancelled)
break;
}
}
messageSink.OnMessage(new TestCollectionFinished { Assembly = assemblyInfo, TestsRun = collectionSummary.Total });
totalSummary.Aggregate(collectionSummary);
}
}
messageSink.OnMessage(new TestAssemblyFinished
{
Assembly = assemblyInfo,
TestsRun = totalSummary.Total,
TestsFailed = totalSummary.Failed,
TestsSkipped = totalSummary.Skipped,
ExecutionTime = totalSummary.Time
});
}
finally
{
Directory.SetCurrentDirectory(currentDirectory);
}
}
开发者ID:johnkg,项目名称:xunit,代码行数:61,代码来源:XunitTestFrameworkExecutor.cs
示例9: CollectionPerAssemblyTestCollectionFactory
/// <summary>
/// Initializes a new instance of the <see cref="CollectionPerAssemblyTestCollectionFactory" /> class.
/// </summary>
/// <param name="testAssembly">The assembly.</param>
/// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param>
public CollectionPerAssemblyTestCollectionFactory(ITestAssembly testAssembly, IMessageSink diagnosticMessageSink)
{
this.testAssembly = testAssembly;
defaultCollection = new TestCollection(testAssembly, null, "Test collection for " + Path.GetFileName(testAssembly.Assembly.AssemblyPath));
collectionDefinitions = TestCollectionFactoryHelper.GetTestCollectionDefinitions(testAssembly.Assembly, diagnosticMessageSink);
}
开发者ID:modai888,项目名称:xunit,代码行数:12,代码来源:CollectionPerAssemblyTestCollectionFactory.cs
示例10: InterceptSink
public InterceptSink(IMessageSink nextSink)
{
lock (SyncRoot)
{
_nextSink = nextSink;
}
}
开发者ID:domitienda,项目名称:DomiLibrary,代码行数:7,代码来源:InterceptSink.cs
示例11: BenchmarkTestCase
public BenchmarkTestCase(
int iterations,
int warmupIterations,
string variation,
IMessageSink diagnosticMessageSink,
ITestMethod testMethod,
object[] testMethodArguments)
: base(diagnosticMessageSink, Xunit.Sdk.TestMethodDisplay.Method, testMethod, null)
{
// Override display name to avoid getting info about TestMethodArguments in the
// name (this is covered by the concept of Variation for benchmarks)
var suppliedDisplayName = TestMethod.Method.GetCustomAttributes(typeof(FactAttribute))
.First()
.GetNamedArgument<string>("DisplayName");
_diagnosticMessageSink = diagnosticMessageSink;
DisplayName = suppliedDisplayName ?? BaseDisplayName;
Variation = variation;
Iterations = iterations;
WarmupIterations = warmupIterations;
var methodArguments = new List<object> { MetricCollector };
if (testMethodArguments != null)
{
methodArguments.AddRange(testMethodArguments);
}
TestMethodArguments = methodArguments.ToArray();
}
开发者ID:491134648,项目名称:EntityFramework,代码行数:29,代码来源:BenchmarkTestCase.cs
示例12: ScenarioOutlineRunner
public ScenarioOutlineRunner(
IMessageSink diagnosticMessageSink,
IXunitTestCase scenarioOutline,
string displayName,
string skipReason,
object[] constructorArguments,
IMessageBus messageBus,
ExceptionAggregator aggregator,
CancellationTokenSource cancellationTokenSource)
: base(
scenarioOutline,
displayName,
skipReason,
constructorArguments,
noArguments,
messageBus,
aggregator,
cancellationTokenSource)
{
this.diagnosticMessageSink = diagnosticMessageSink;
this.scenarioRunnerFactory = new ScenarioRunnerFactory(
this.TestCase,
this.DisplayName,
this.MessageBus,
this.TestClass,
this.ConstructorArguments,
this.SkipReason,
this.BeforeAfterAttributes,
this.Aggregator,
this.CancellationTokenSource);
}
开发者ID:thomaslevesque,项目名称:xbehave.net,代码行数:31,代码来源:ScenarioOutlineRunner.cs
示例13: RunTestCases
protected override void RunTestCases(IEnumerable<IXunitTestCase> testCases, IMessageSink messageSink, ITestFrameworkOptions executionOptions)
{
var cases = testCases.Where(t =>
t.Class.GetCustomAttributes(typeof(RunIfConfiguredAttribute)) == null
|| TestConfig.Instance.IsConfigured);
base.RunTestCases(cases, messageSink, executionOptions);
}
开发者ID:Nyaoso,项目名称:EntityFramework,代码行数:7,代码来源:AtsTestFramework.cs
示例14: DoAsyncDispatch
internal static IMessageCtrl DoAsyncDispatch(IMessage reqMsg, IMessageSink replySink)
{
object[] args = new object[4];
ServerIdentity serverIdentity = InternalSink.GetServerIdentity(reqMsg);
if (RemotingServices.CORProfilerTrackRemotingAsync())
{
Guid empty = Guid.Empty;
if (RemotingServices.CORProfilerTrackRemotingCookie())
{
object obj2 = reqMsg.Properties["CORProfilerCookie"];
if (obj2 != null)
{
empty = (Guid) obj2;
}
}
RemotingServices.CORProfilerRemotingServerReceivingMessage(empty, true);
if (replySink != null)
{
IMessageSink sink = new ServerAsyncReplyTerminatorSink(replySink);
replySink = sink;
}
}
Context serverContext = serverIdentity.ServerContext;
args[0] = reqMsg;
args[1] = replySink;
args[2] = Thread.CurrentContext;
args[3] = serverContext;
InternalCrossContextDelegate ftnToCall = new InternalCrossContextDelegate(CrossContextChannel.DoAsyncDispatchCallback);
return (IMessageCtrl) Thread.CurrentThread.InternalCrossContextCallback(serverContext, ftnToCall, args);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:CrossContextChannel.cs
示例15: ForwardMethod
public static LNode ForwardMethod(LNode fn, IMessageSink sink)
{
LNode args, fwd, body;
if (fn.ArgCount != 4 || !(fwd = fn.Args[3]).Calls(S.Forward, 1) || !(args = fn.Args[2]).Calls(S.List))
return null;
RVList<LNode> formalArgs = args.Args;
RVList<LNode> argList = RVList<LNode>.Empty;
foreach (var formalArg in formalArgs)
{
if (!formalArg.Calls(S.Var, 2))
return Reject(sink, formalArg, "'==>' expected a variable declaration here");
LNode argName = formalArg.Args[1];
if (argName.Calls(S.Assign, 2))
argName = argName.Args[0];
LNode @ref = formalArg.AttrNamed(S.Ref) ?? formalArg.AttrNamed(S.Out);
if (@ref != null)
argName = argName.PlusAttr(@ref);
argList.Add(argName);
}
LNode target = GetForwardingTarget(fwd, fn.Args[1]);
LNode call = F.Call(target, argList);
bool isVoidFn = fn.Args[0].IsIdNamed(S.Void);
body = F.Braces(isVoidFn ? call : F.Call(S.Return, call));
return fn.WithArgChanged(3, body);
}
开发者ID:Shaykh,项目名称:Loyc,代码行数:28,代码来源:ForwardingMacro.cs
示例16: AOPSinkProcessor
/// <summary>
/// Initializes a new instance of the <see cref="AOPSinkProcessor" /> class.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="nextSink">The next sink.</param>
/// <param name="messageDelegates">The message delegates.</param>
public AOPSinkProcessor(MarshalByRefObject sender, IMessageSink nextSink, MessageProcessDelegates messageDelegates)
{
this.NextSink = nextSink;
this.Sender = sender;
this.messageDelegates = messageDelegates;
}
开发者ID:rynnwang,项目名称:CommonSolution,代码行数:13,代码来源:AOPSinkProcessor.cs
示例17: ForwardProperty
public static LNode ForwardProperty(LNode prop, IMessageSink sink)
{
LNode name, fwd, body;
if (prop.ArgCount != 3)
return null;
LNode target = GetForwardingTarget(fwd = prop.Args[2], name = prop.Args[1]);
if (target != null)
{
body = F.Braces(new RVList<LNode>(
F.Call(S.get, F.Braces(F.Call(S.Return, target))),
F.Call(S.set, F.Braces(F.Call(S.Assign, target, F.Id(S.value))))));
return prop.WithArgChanged(2, body);
}
else if ((body = fwd).Calls(S.Braces))
{
var body2 = body.WithArgs(stmt => {
if (stmt.Calls(S.get, 1) && (target = GetForwardingTarget(stmt.Args[0], name)) != null)
return stmt.WithArgs(new RVList<LNode>(F.Braces(F.Call(S.Return, target))));
if (stmt.Calls(S.set, 1) && (target = GetForwardingTarget(stmt.Args[0], name)) != null)
return stmt.WithArgs(new RVList<LNode>(F.Braces(F.Call(S.Assign, target, F.Id(S.value)))));
return stmt;
});
if (body2 != body)
return prop.WithArgChanged(2, body2);
}
return null;
}
开发者ID:Shaykh,项目名称:Loyc,代码行数:28,代码来源:ForwardingMacro.cs
示例18: WcfTestCase
internal WcfTestCase(IXunitTestCase testCase, string skippedReason = null, bool isTheory = false, IMessageSink diagnosticMessageSink = null)
{
_testCase = testCase;
_skippedReason = skippedReason;
_isTheory = isTheory;
_diagnosticMessageSink = diagnosticMessageSink;
}
开发者ID:roncain,项目名称:wcf,代码行数:7,代码来源:WcfTestCase.cs
示例19: ContextClientSink
public ContextClientSink(object next)
{
if (!typeof(IMessageSink).IsInstanceOfType(next))
throw new ArgumentOutOfRangeException("next");
_nextSink = (IMessageSink)next;
}
开发者ID:rreynolds-yp,项目名称:csharp-swift-consoleclient,代码行数:7,代码来源:ContextClientSink.cs
示例20: BrowserTestFrameworkExecutor
/// <summary>
/// Initializes a new instance of the <see cref="T:Xunit.Sdk.XunitTestFrameworkExecutor"/> class.
/// </summary>
/// <param name="assemblyName">Name of the test assembly.</param><param name="sourceInformationProvider">The source line number information provider.</param><param name="diagnosticMessageSink">The message sink to report diagnostic messages to.</param>
public BrowserTestFrameworkExecutor(
AssemblyName assemblyName,
ISourceInformationProvider sourceInformationProvider,
IMessageSink diagnosticMessageSink)
: base(assemblyName, sourceInformationProvider, diagnosticMessageSink)
{
}
开发者ID:RichiCoder1,项目名称:Browser.xUnit,代码行数:11,代码来源:BrowserTestFrameworkExecutor.cs
注:本文中的IMessageSink类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论