-
Notifications
You must be signed in to change notification settings - Fork 301
/
AutoUpdatedFiles.cs
39 lines (36 loc) · 1.37 KB
/
AutoUpdatedFiles.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace IntegrityTests
{
class AutoUpdatedFiles
{
[Test]
public void EnsureUpdatedFilesExist()
{
string[] paths = [
"nservicebus/upgrades/supported-versions-nservicebus.include.md",
"nservicebus/upgrades/supported-versions-downstreams.include.md",
"nservicebus/upgrades/all-versions.include.md",
"servicecontrol/upgrades/supported-versions-servicecontrol.include.md",
];
Assert.Multiple(() =>
{
foreach (var path in paths)
{
var fullPath = Path.GetFullPath(Path.Combine(TestSetup.DocsRootPath, path));
var fileInfo = new FileInfo(fullPath);
Assert.That(fileInfo.Exists, Is.True, $"Docs path '{path}' must exist because it is automatically updated by a scheduled process, and can't be moved.");
if (fileInfo.Exists)
{
Assert.That(fileInfo.Length, Is.GreaterThan(200), $"Docs path '{path}' exists but seems suspiciously small. This might be indicative of a problem.");
}
}
});
}
}
}