-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathAuditDeploymentPackageTests.cs
More file actions
49 lines (41 loc) · 1.97 KB
/
AuditDeploymentPackageTests.cs
File metadata and controls
49 lines (41 loc) · 1.97 KB
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
40
41
42
43
44
45
46
47
48
49
namespace Tests
{
using System.IO;
using System.Linq;
using NUnit.Framework;
[TestFixture]
public class AuditDeploymentPackageTests
{
public AuditDeploymentPackageTests()
{
deploymentPackage = DeploymentPackage.All.Single(d => d.ServiceName.Contains("Audit"));
}
[Test]
public void Should_package_storages_individually()
{
var expectedPersisters = new[] {
"RavenDB35", // Still must exist, as Raven35 persistence.manifest file must be available for SCMU to understand old versions
"RavenDB"
};
var persisters = deploymentPackage.DeploymentUnits.Where(u => u.Category == "Persisters");
Assert.That(persisters.Select(d => d.Name), Is.EquivalentTo(expectedPersisters), $"Expected Persisters folder to contain {string.Join(',', expectedPersisters)}");
foreach (var persister in persisters)
{
Assert.That(persister.Files.Any(f => f.Name.EndsWith(".config")), Is.False, $"{persister.Name} contains a config file");
Assert.That(persister.Files.Any(f => f.Name == "persistence.manifest"), Is.True, $"{persister.Name} doesn't contain a persistence.manifest file");
}
}
[Test]
public void Raven_server_should_be_included()
{
var inPersisterPath = Path.Combine(deploymentPackage.Directory.FullName, "Persisters", "RavenDB", "RavenDBServer");
var separateAssetPath = Path.GetFullPath(Path.Combine(deploymentPackage.Directory.FullName, "..", "RavenDBServer"));
Assert.Multiple(() =>
{
Assert.That(inPersisterPath, Does.Not.Exist, "RavenDBServer should not be bundled inside the persister");
Assert.That(separateAssetPath, Does.Exist, "RavenDBServer should be bundled as its own resource");
});
}
readonly DeploymentPackage deploymentPackage;
}
}