forked from microsoft/VFSForGit
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMockPlatform.cs
More file actions
119 lines (96 loc) · 3.8 KB
/
MockPlatform.cs
File metadata and controls
119 lines (96 loc) · 3.8 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using GVFS.Common;
using GVFS.Common.FileSystem;
using GVFS.Common.Git;
using GVFS.Common.Tracing;
using GVFS.UnitTests.Mock.Common.Tracing;
using GVFS.UnitTests.Mock.FileSystem;
using GVFS.UnitTests.Mock.Git;
using System;
using System.Collections.Generic;
using System.IO.Pipes;
namespace GVFS.UnitTests.Mock.Common
{
public class MockPlatform : GVFSPlatform
{
public MockPlatform()
: base(executableExtension: ".mockexe", installerExtension: ".mockexe")
{
}
public override IKernelDriver KernelDriver => throw new NotSupportedException();
public override IGitInstallation GitInstallation { get; } = new MockGitInstallation();
public override IDiskLayoutUpgradeData DiskLayoutUpgrade => throw new NotSupportedException();
public override IPlatformFileSystem FileSystem { get; } = new MockPlatformFileSystem();
public override void ConfigureVisualStudio(string gitBinPath, ITracer tracer)
{
throw new NotSupportedException();
}
public override bool TryGetGVFSHooksPathAndVersion(out string hooksPaths, out string hooksVersion, out string error)
{
throw new NotSupportedException();
}
public override bool TryInstallGitCommandHooks(GVFSContext context, string executingDirectory, string hookName, string commandHookPath, out string errorMessage)
{
throw new NotSupportedException();
}
public override string GetNamedPipeName(string enlistmentRoot)
{
return "GVFS_Mock_PipeName";
}
public override NamedPipeServerStream CreatePipeByName(string pipeName)
{
throw new NotSupportedException();
}
public override InProcEventListener CreateTelemetryListenerIfEnabled(string providerName, string enlistmentId, string mountId)
{
return new MockListener(EventLevel.Verbose, Keywords.Telemetry);
}
public override string GetCurrentUser()
{
throw new NotSupportedException();
}
public override string GetOSVersionInformation()
{
throw new NotSupportedException();
}
public override Dictionary<string, string> GetPhysicalDiskInfo(string path, bool sizeStatsOnly)
{
return new Dictionary<string, string>();
}
public override void InitializeEnlistmentACLs(string enlistmentPath)
{
throw new NotSupportedException();
}
public override bool IsConsoleOutputRedirectedToFile()
{
throw new NotSupportedException();
}
public override bool IsElevated()
{
throw new NotSupportedException();
}
public override bool IsProcessActive(int processId)
{
throw new NotSupportedException();
}
public override void IsServiceInstalledAndRunning(string name, out bool installed, out bool running)
{
throw new NotSupportedException();
}
public override bool TryGetGVFSEnlistmentRoot(string directory, out string enlistmentRoot, out string errorMessage)
{
throw new NotSupportedException();
}
public override void StartBackgroundProcess(string programName, string[] args)
{
throw new NotSupportedException();
}
public override bool IsGitStatusCacheSupported()
{
return true;
}
public override FileBasedLock CreateFileBasedLock(PhysicalFileSystem fileSystem, ITracer tracer, string lockPath)
{
return new MockFileBasedLock(fileSystem, tracer, lockPath);
}
}
}