forked from ravendb/ravendb
/
IISClientTestBase.cs
38 lines (32 loc) · 1.16 KB
/
IISClientTestBase.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
using System.IO;
using Raven.Client;
using Raven.Database.Extensions;
namespace Raven.Tests
{
public abstract class IISClientTestBase
{
protected const string WebDirectory = @".\RavenIISTestWeb\";
public static string DeployWebProjectToTestDirectory()
{
var fullPath = Path.GetFullPath(WebDirectory);
if (!Directory.Exists(fullPath))
{
IOExtensions.CopyDirectory(GetRavenWebSource(), WebDirectory);
}
return fullPath;
}
private static string GetRavenWebSource()
{
foreach (var path in new[] { @".\..\..\..\Raven.Web", @".\_PublishedWebsites\Raven.Web" })
{
var fullPath = Path.GetFullPath(path);
if (Directory.Exists(fullPath) && Directory.Exists(Path.Combine(fullPath, "bin")))
{
return fullPath;
}
}
throw new FileNotFoundException("Could not find source directory for Raven.Web");
}
public abstract IDocumentStore GetDocumentStore();
}
}