Created
September 16, 2016 16:10
-
-
Save pauldambra/6b9cee1d7c39aa7893606927ca969d22 to your computer and use it in GitHub Desktop.
akka.net test that fails before Tell has had time to run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WhenContentWasAlreadyPublished : TestKit, ILoadUmbracoNodes, IPublishUmbracoContent | |
{ | |
private IContent _content; | |
private IContent _publishedContent; | |
private bool _publishContentCalled; | |
[Fact] | |
public void ItPublishesWhenAsked() | |
{ | |
var publisherProps = UmbracoAdmin.ContentPublishing.NodePublisher.Props(this, this); | |
var publisher = Sys.ActorOf(publisherProps); | |
publisher.Tell(Get(1)); | |
_publishContentCalled.Should().BeTrue(); | |
_publishedContent.Should().Be(_content); | |
} | |
public IContent Get(int id) | |
{ | |
_content = A.Fake<IContent>(); | |
A.CallTo(() => _content.HasPublishedVersion).Returns(true); | |
return _content; | |
} | |
public Attempt<PublishStatus> Publish(IContent content) | |
{ | |
_publishedContent = content; | |
_publishContentCalled = true; | |
return Attempt<PublishStatus>.Succeed(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment