This repository has been archived by the owner on Oct 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 771
/
TestableSharpDevelopProjectSystem.cs
76 lines (65 loc) · 2.79 KB
/
TestableSharpDevelopProjectSystem.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
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
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.Design;
using ICSharpCode.SharpDevelop.Project;
namespace PackageManagement.Tests.Helpers
{
public class TestableSharpDevelopProjectSystem : SharpDevelopProjectSystem
{
public string PathPassedToPhysicalFileSystemAddFile;
public Stream StreamPassedToPhysicalFileSystemAddFile;
public FakeFileService FakeFileService;
public FakePackageManagementOutputMessagesView FakeOutputMessagesView;
public string FileNamePassedToLogDeletedFile;
public FileNameAndDirectory FileNameAndDirectoryPassedToLogDeletedFileFromDirectory;
public string DirectoryPassedToLogDeletedDirectory;
public ReferenceAndProjectName ReferenceAndProjectNamePassedToLogAddedReferenceToProject;
public ReferenceAndProjectName ReferenceAndProjectNamePassedToLogRemovedReferenceFromProject;
public FileNameAndProjectName FileNameAndProjectNamePassedToLogAddedFileToProject;
public TestableSharpDevelopProjectSystem(MSBuildBasedProject project)
: this(project, new FakeFileService(project))
{
}
TestableSharpDevelopProjectSystem(MSBuildBasedProject project, IPackageManagementFileService fileService)
: base(project, fileService)
{
FakeFileService = (FakeFileService)fileService;
Logger = FakeOutputMessagesView;
}
protected override void PhysicalFileSystemAddFile(string path, Stream stream)
{
PathPassedToPhysicalFileSystemAddFile = path;
StreamPassedToPhysicalFileSystemAddFile = stream;
}
protected override void LogDeletedFile(string fileName)
{
FileNamePassedToLogDeletedFile = fileName;
}
protected override void LogDeletedFileFromDirectory(string fileName, string directory)
{
FileNameAndDirectoryPassedToLogDeletedFileFromDirectory = new FileNameAndDirectory(fileName, directory);
}
protected override void LogDeletedDirectory(string directory)
{
DirectoryPassedToLogDeletedDirectory = directory;
}
protected override void LogAddedReferenceToProject(string referenceName, string projectName)
{
ReferenceAndProjectNamePassedToLogAddedReferenceToProject =
new ReferenceAndProjectName(referenceName, projectName);
}
protected override void LogRemovedReferenceFromProject(string referenceName, string projectName)
{
ReferenceAndProjectNamePassedToLogRemovedReferenceFromProject =
new ReferenceAndProjectName(referenceName, projectName);
}
protected override void LogAddedFileToProject(string fileName, string projectName)
{
FileNameAndProjectNamePassedToLogAddedFileToProject =
new FileNameAndProjectName(fileName, projectName);
}
}
}