Skip to content

Commit 625bd47

Browse files
committed
Updating unit tests after introduction of GenerateFeeds warning
1 parent 28cbf57 commit 625bd47

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

tests/extensions/Statiq.Feeds.Tests/GenerateFeedsFixture.cs

+19-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public async Task DoesNotChangeImageDomain()
1919
{
2020
// Given
2121
TestExecutionContext context = new TestExecutionContext();
22-
context.Settings[Keys.Host] = "buzz.com";
22+
context.Settings[Keys.Host] = "statiq.dev";
2323
TestDocument document = new TestDocument(
2424
new NormalizedPath("/input/fizz/buzz"),
2525
new NormalizedPath("fizz/buzz"),
@@ -41,6 +41,8 @@ public async Task DoesNotChangeImageDomain()
4141
public async Task OrdersByPublish()
4242
{
4343
// Given
44+
TestExecutionContext context = new TestExecutionContext();
45+
context.Settings[Keys.Host] = "statiq.dev";
4446
TestDocument a = new TestDocument(new NormalizedPath("a.txt"))
4547
{
4648
{ FeedKeys.Title, "A" },
@@ -54,7 +56,7 @@ public async Task OrdersByPublish()
5456
GenerateFeeds module = new GenerateFeeds();
5557

5658
// When
57-
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, module);
59+
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, context, module);
5860

5961
// Then
6062
TestDocument result = results.Single(x => x.Destination.FullPath == "feed.rss");
@@ -65,6 +67,9 @@ public async Task OrdersByPublish()
6567
public async Task ShouldSetFeedTitleFromMetadata()
6668
{
6769
// Given
70+
TestExecutionContext context = new TestExecutionContext();
71+
context.Settings[FeedKeys.Title] = "My Feed";
72+
context.Settings[Keys.Host] = "statiq.dev";
6873
TestDocument a = new TestDocument(new NormalizedPath("a.txt"))
6974
{
7075
{ FeedKeys.Title, "A" },
@@ -75,8 +80,6 @@ public async Task ShouldSetFeedTitleFromMetadata()
7580
{ FeedKeys.Title, "B" },
7681
{ FeedKeys.Published, new DateTime(2010, 2, 1) }
7782
};
78-
TestExecutionContext context = new TestExecutionContext();
79-
context.Settings[FeedKeys.Title] = "My Feed";
8083
GenerateFeeds module = new GenerateFeeds();
8184

8285
// When
@@ -91,6 +94,8 @@ public async Task ShouldSetFeedTitleFromMetadata()
9194
public async Task ShouldSetDefaultFeedTitleIfNoMetadata()
9295
{
9396
// Given
97+
TestExecutionContext context = new TestExecutionContext();
98+
context.Settings[Keys.Host] = "statiq.dev";
9499
TestDocument a = new TestDocument(new NormalizedPath("a.txt"))
95100
{
96101
{ FeedKeys.Title, "A" },
@@ -104,7 +109,7 @@ public async Task ShouldSetDefaultFeedTitleIfNoMetadata()
104109
GenerateFeeds module = new GenerateFeeds();
105110

106111
// When
107-
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, module);
112+
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, context, module);
108113

109114
// Then
110115
TestDocument result = results.Single(x => x.Destination.FullPath == "feed.rss");
@@ -115,6 +120,8 @@ public async Task ShouldSetDefaultFeedTitleIfNoMetadata()
115120
public async Task ShouldSetFeedTitleFromFluentMethod()
116121
{
117122
// Given
123+
TestExecutionContext context = new TestExecutionContext();
124+
context.Settings[Keys.Host] = "statiq.dev";
118125
TestDocument a = new TestDocument(new NormalizedPath("a.txt"))
119126
{
120127
{ FeedKeys.Title, "A" },
@@ -128,7 +135,7 @@ public async Task ShouldSetFeedTitleFromFluentMethod()
128135
GenerateFeeds module = new GenerateFeeds().WithFeedTitle("Best Feed");
129136

130137
// When
131-
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, module);
138+
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, context, module);
132139

133140
// Then
134141
TestDocument result = results.Single(x => x.Destination.FullPath == "feed.rss");
@@ -140,6 +147,8 @@ public async Task ShouldSetFeedTitleFromFluentMethod()
140147
public async Task ShouldSetDefaultFeedTitleIfNullOrEmptyFluentTitle(string feedTitle)
141148
{
142149
// Given
150+
TestExecutionContext context = new TestExecutionContext();
151+
context.Settings[Keys.Host] = "statiq.dev";
143152
TestDocument a = new TestDocument(new NormalizedPath("a.txt"))
144153
{
145154
{ FeedKeys.Title, "A" },
@@ -153,7 +162,7 @@ public async Task ShouldSetDefaultFeedTitleIfNullOrEmptyFluentTitle(string feedT
153162
GenerateFeeds module = new GenerateFeeds().WithFeedTitle(feedTitle);
154163

155164
// When
156-
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, module);
165+
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, context, module);
157166

158167
// Then
159168
TestDocument result = results.Single(x => x.Destination.FullPath == "feed.rss");
@@ -164,6 +173,8 @@ public async Task ShouldSetDefaultFeedTitleIfNullOrEmptyFluentTitle(string feedT
164173
public async Task PreservesInputOrder()
165174
{
166175
// Given
176+
TestExecutionContext context = new TestExecutionContext();
177+
context.Settings[Keys.Host] = "statiq.dev";
167178
TestDocument a = new TestDocument(new NormalizedPath("a.txt"))
168179
{
169180
{ FeedKeys.Title, "A" },
@@ -177,7 +188,7 @@ public async Task PreservesInputOrder()
177188
GenerateFeeds module = new GenerateFeeds().PreserveOrdering();
178189

179190
// When
180-
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, module);
191+
IReadOnlyList<TestDocument> results = await ExecuteAsync(new[] { a, b }, context, module);
181192

182193
// Then
183194
TestDocument result = results.Single(x => x.Destination.FullPath == "feed.rss");

0 commit comments

Comments
 (0)