本文整理汇总了C#中IPublisher.PublishMessage方法的典型用法代码示例。如果您正苦于以下问题:C# IPublisher.PublishMessage方法的具体用法?C# IPublisher.PublishMessage怎么用?C# IPublisher.PublishMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPublisher
的用法示例。
在下文中一共展示了IPublisher.PublishMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
_testCommand = A.Fake<ICommand>();
_publisher = A.Fake<IPublisher>();
_compositeApp = A.Fake<ICompositeApp>();
_registry = A.Fake<ICommandRegistry>();
_formatter = A.Fake<IResponseFormatter>();
_publicationRecord = A.Fake<ICommandPublicationRecord>();
_jsonSerializer = new DefaultJsonSerializer();
_xmlSerializer = new DefaultXmlSerializer();
A.CallTo(() => _testCommand.Created).Returns(DateTime.MaxValue);
A.CallTo(() => _testCommand.CreatedBy).Returns(new Guid("ba5f18dc-e287-4d9e-ae71-c6989b10d778"));
A.CallTo(() => _testCommand.Identifier).Returns(new Guid("ba5f18dc-e287-4d9e-ae71-c6989b10d778"));
A.CallTo(() => _formatter.Serializers).Returns(new List<ISerializer> { _jsonSerializer, _xmlSerializer });
A.CallTo(() => _publicationRecord.Dispatched).Returns(true);
A.CallTo(() => _publicationRecord.Error).Returns(false);
A.CallTo(() => _publicationRecord.Completed).Returns(true);
A.CallTo(() => _publicationRecord.Created).Returns(DateTime.MinValue);
A.CallTo(() => _publicationRecord.MessageLocation).Returns(new Uri("http://localhost/fake/message"));
A.CallTo(() => _publicationRecord.MessageType).Returns(typeof(IPublicationRecord));
A.CallTo(() => _publicationRecord.CreatedBy).Returns(Guid.Empty);
A.CallTo(() => _compositeApp.GetCommandForInputModel(A.Dummy<IInputModel>())).Returns(_testCommand);
A.CallTo(() => _publisher.PublishMessage(A.Fake<ICommand>())).Returns(_publicationId);
A.CallTo(() => _registry.GetPublicationRecord(_publicationId)).Returns(_publicationRecord);
_euclidApi = new ApiModule(_compositeApp, _registry, _publisher);
}