public void Notify_Published_Stories_Should_Send_PublishStories() { const string mailTemplate = "Story Published: <%=timestamp%>\r\n"; var category = new Mock <ICategory>(); category.ExpectGet(c => c.Name).Returns("Dummy"); var story = new Mock <IStory>(); story.ExpectGet(s => s.Title).Returns("A dummy story"); story.ExpectGet(s => s.BelongsTo).Returns(category.Object); story.ExpectGet(s => s.Url).Returns("http://dummystory.com"); var publishedStory = new PublishedStory(story.Object) { Rank = 1 }; publishedStory.Weights.Add("View", 10); publishedStory.Weights.Add("Vote", 300); publishedStory.Weights.Add("Comment", 130); publishedStory.Weights.Add("User-Score", 450); publishedStory.Weights.Add("Known-Source", 5); publishedStory.Weights.Add("Freshness", 50); _file.Expect(f => f.ReadAllText(It.IsAny <string>())).Returns(mailTemplate).Verifiable(); _emailSender.NotifyPublishedStories(SystemTime.Now(), new[] { publishedStory }); Sleep(); }
public PublishedStoryFixture() { _publishedStory = new PublishedStory(new Mock <IStory>().Object); }