public async Task CreateTest() { var fakeBus = new FakeBus(); var dataStore = fakeBus.GetDataBusDataStore(); var handler = new DataBusAttachmentCreatingHandler(fakeBus); await handler.Handle("hej med dig min ven!"); var sentDataBusAttachments = fakeBus.Events .OfType <MessageSent <DataBusAttachment> >() .ToList(); Assert.That(sentDataBusAttachments.Count, Is.EqualTo(1)); var attachmentId = sentDataBusAttachments.First().CommandMessage.Id; var data = dataStore.Load(attachmentId); var textData = Encoding.UTF8.GetString(data); Assert.That(textData, Is.EqualTo("hej med dig min ven!")); }