forked from microsoft/scalar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCacheServerTests.cs
More file actions
38 lines (30 loc) · 1.52 KB
/
CacheServerTests.cs
File metadata and controls
38 lines (30 loc) · 1.52 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
using NUnit.Framework;
using Scalar.FunctionalTests.Tools;
using Scalar.Tests.Should;
namespace Scalar.FunctionalTests.Tests.EnlistmentPerFixture
{
[TestFixture]
public class CacheServerTests : TestsWithEnlistmentPerFixture
{
private const string CustomUrl = "https://myCache";
[TestCase]
public void SettingGitConfigChangesCacheServer()
{
ProcessResult result = GitProcess.InvokeProcess(this.Enlistment.RepoRoot, "config gvfs.cache-server " + CustomUrl);
result.ExitCode.ShouldEqual(0, result.Errors);
this.Enlistment.GetCacheServer().ShouldContain("Using cache server: User Defined (" + CustomUrl + ")");
}
[TestCase]
public void SetAndGetTests()
{
this.Enlistment.SetCacheServer("\"\"").ShouldContain("You must specify a value for the cache server");
string noneMessage = "Using cache server: None (" + this.Enlistment.RepoUrl + ")";
this.Enlistment.SetCacheServer("None").ShouldContain(noneMessage);
this.Enlistment.GetCacheServer().ShouldContain(noneMessage);
this.Enlistment.SetCacheServer(this.Enlistment.RepoUrl).ShouldContain(noneMessage);
this.Enlistment.GetCacheServer().ShouldContain(noneMessage);
this.Enlistment.SetCacheServer(CustomUrl).ShouldContain("Using cache server: User Defined (" + CustomUrl + ")");
this.Enlistment.GetCacheServer().ShouldContain("Using cache server: User Defined (" + CustomUrl + ")");
}
}
}