public void poll() { var descriptor = _queue.LoadTask(_pathToTask); InitializeDocumentDescriptor command = null; _commandBus.When(c => c.Send(Arg.Any <InitializeDocumentDescriptor>(), Arg.Any <string>())) .Do(callInfo => command = (InitializeDocumentDescriptor)callInfo.Args()[0]); _queue.PollFileSystem(); // asserts _blobstore.Received().Upload(Arg.Is(_originalFormat), Arg.Is <FileNameWithExtension>(f => f.ToString() == descriptor.FileName), Arg.Any <Stream>()); var calls = _blobstore.ReceivedCalls(); Assert.NotNull(command); Assert.AreEqual(_blobId, command.BlobId); Assert.NotNull(command.HandleInfo); Assert.AreEqual(_documentHandle, command.HandleInfo.Handle); }