Skip to content

Commit 75ce1a4

Browse files
committed
output folder cleanup tests adjusted
1 parent b744a73 commit 75ce1a4

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/Test/SolidifyProject.Engine.Test.Integration/Infrastructure/Services/OrchestrationServiceTest.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public class OrchestrationServiceTest
4242

4343
private IHtmlMinificationService HtmlMinificationService => new GoogleHtmlMinificationService();
4444

45+
46+
private const string PAGE_CONTENT = "<html><head><link href=\"/assets/style.css\" rel=\"stylesheet\" type=\"text/css\"><title>Static Site Generator - Home</title><link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/Assets/favicon.ico\"></head><body><div><ul><li><a href=\"https://facebook.com\">Facebook</a></li><li><a href=\"https://twitter.com\">Twitter</a></li></ul></div><h1>Welcome to Static Site Generator!</h1><h4>Authors</h4><h5>Founders</h5><ul><li>Anton Boyko (Microsoft Azure MVP)</li></ul><h5>Contributors</h5><p><strong>Powered by .NET Core 2.0</strong></p><div><i>All rights reserved</i></div></body></html>";
47+
48+
4549
[TearDown]
4650
public void TearDown()
4751
{
@@ -81,7 +85,7 @@ public async Task ProduceHtml()
8185

8286
var page = _pageModelWriterStorage.Single(x => x.Id.Equals("index.html"));
8387

84-
Assert.AreEqual("<html><head><link href=\"/assets/style.css\" rel=\"stylesheet\" type=\"text/css\"><title>Static Site Generator - Home</title><link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/Assets/favicon.ico\"></head><body><div><ul><li><a href=\"https://facebook.com\">Facebook</a></li><li><a href=\"https://twitter.com\">Twitter</a></li></ul></div><h1>Welcome to Static Site Generator!</h1><h4>Authors</h4><h5>Founders</h5><ul><li>Anton Boyko (Microsoft Azure MVP)</li></ul><h5>Contributors</h5><p><strong>Powered by .NET Core 2.0</strong></p><div><i>All rights reserved</i></div></body></html>", page.ContentRaw);
88+
Assert.AreEqual(PAGE_CONTENT, page.ContentRaw);
8589
}
8690

8791
[Test]
@@ -128,15 +132,15 @@ public async Task CleanUpBeforeRender()
128132
Assert.AreEqual(2, _pageModelWriterStorage.Count);
129133
Assert.IsFalse(_pageModelWriterStorage.All(x => x.ContentRaw == null));
130134

131-
Assert.AreEqual(2, _assetsWriterStorage.Count);
135+
Assert.AreEqual(3, _assetsWriterStorage.Count);
132136
Assert.IsFalse(_assetsWriterStorage.All(x => x.ContentRaw == null));
133137

134138
var logoAsset = _assetsWriterStorage.SingleOrDefault(x => x.Id.Contains("img") && x.Id.Contains("logo.png"));
135139
Assert.IsNotNull(logoAsset);
136140

137141
var page = _pageModelWriterStorage.Single(x => x.Id.Equals("index.html"));
138142

139-
Assert.AreEqual("<html><head><link href=\"/assets/style.css\" rel=\"stylesheet\" type=\"text/css\"><title>Static Site Generator - Home</title></head><body><div><ul><li><a href=\"https://facebook.com\">Facebook</a></li><li><a href=\"https://twitter.com\">Twitter</a></li></ul></div><h1>Welcome to Static Site Generator!</h1><h4>Authors</h4><h5>Founders</h5><ul><li>Anton Boyko (Microsoft Azure MVP)</li></ul><h5>Contributors</h5><p><strong>Powered by .NET Core 2.0</strong></p><div><i>All rights reserved</i></div></body></html>", page.ContentRaw);
143+
Assert.AreEqual(PAGE_CONTENT, page.ContentRaw);
140144
}
141145
}
142146
}

src/Test/SolidifyProject.Engine.Test.Unit/Infrastructure/Services/ContentWriterService/_ContentWriterServiceTestBase.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ public virtual async Task CleanOutputAsyncTest(T newElement)
3232
{
3333
await ContentWriterService.SaveContentAsync(newElement.Id, newElement);
3434

35+
var actualElement = await ContentReaderService.LoadContentByIdAsync(newElement.Id);
36+
37+
Assert.IsNotNull(actualElement);
38+
3539
await ContentWriterService.CleanFolderAsync("");
3640

37-
var newElementActual = await ContentReaderService.LoadContentByIdAsync(newElement.Id);
41+
actualElement = await ContentReaderService.LoadContentByIdAsync(newElement.Id);
3842

39-
Assert.IsNull(newElementActual);
43+
Assert.IsNull(actualElement);
4044
}
4145
}
4246
}

0 commit comments

Comments
 (0)