public void ExtractTopic_WithMessage_DeserializesPackage() { // Arrange var messageFactory = new NetMQMessageFactory(serializerCache, packageFactory); var message = messageFactory.CreateTopicMessage(obj); // Act var topicEvent = messageFactory.ExtractTopic(message); // Assert mockSerializer.Verify(m => m.Deserialize <Package>(It.IsIn <byte[]>(data)), Times.Once); }
public void ExtractTopic_WithMessage_UnpacksTopicEvent() { // Arrange var messageFactory = new NetMQMessageFactory(serializerCache, packageFactory); var message = messageFactory.CreateTopicMessage(obj); // Act var topicEvent = messageFactory.ExtractTopic(message); // Assert mockPackageFactory.Verify(m => m.Unpack(It.IsIn <Package>(package)), Times.Once); }
public void ExtractTopic_WithMessage_ReturnsTopicEvent() { // Arrange var messageFactory = new NetMQMessageFactory(serializerCache, packageFactory); var message = messageFactory.CreateTopicMessage(obj); // Act var topicEvent = messageFactory.ExtractTopic(message); // Assert Assert.That(topicEvent, Is.EqualTo(obj)); }