You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.5 KiB
84 lines
2.5 KiB
// 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.Collections.ObjectModel; |
|
using ICSharpCode.SharpDevelop.Internal.Templates; |
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
namespace PackageManagement.Tests.Helpers |
|
{ |
|
public class TestableProject : MSBuildBasedProject |
|
{ |
|
public bool IsSaved; |
|
string assemblyName; |
|
string rootNamespace; |
|
|
|
public ItemType ItemTypeToReturnFromGetDefaultItemType { |
|
get { return TestableProjectBehaviour.ItemTypeToReturnFromGetDefaultItemType; } |
|
set { TestableProjectBehaviour.ItemTypeToReturnFromGetDefaultItemType = value; } |
|
} |
|
|
|
public ReadOnlyCollection<ProjectItem> ItemsWhenSaved; |
|
|
|
public TestableProject(ProjectCreateInformation createInfo) |
|
: base(createInfo) |
|
{ |
|
} |
|
|
|
public override void Save(string fileName) |
|
{ |
|
IsSaved = true; |
|
ItemsWhenSaved = Items; |
|
} |
|
|
|
public string FileNamePassedToGetDefaultItemType { |
|
get { return TestableProjectBehaviour.FileNamePassedToGetDefaultItemType; } |
|
} |
|
|
|
public TestableProjectBehaviour TestableProjectBehaviour = new TestableProjectBehaviour(); |
|
|
|
protected override ProjectBehavior GetOrCreateBehavior() |
|
{ |
|
return TestableProjectBehaviour; |
|
} |
|
|
|
public ReferenceProjectItem AddReference(string include) |
|
{ |
|
var referenceProjectItem = new ReferenceProjectItem(this, include); |
|
ProjectService.AddProjectItem(this, referenceProjectItem); |
|
return referenceProjectItem; |
|
} |
|
|
|
public ProjectReferenceProjectItem AddProjectReference(IProject referencedProject) |
|
{ |
|
var referenceProjectItem = new ProjectReferenceProjectItem(this, referencedProject); |
|
ProjectService.AddProjectItem(this, referenceProjectItem); |
|
return referenceProjectItem; |
|
} |
|
|
|
public FileProjectItem AddFile(string include) |
|
{ |
|
var fileProjectItem = new FileProjectItem(this, ItemType.Compile, include); |
|
ProjectService.AddProjectItem(this, fileProjectItem); |
|
return fileProjectItem; |
|
} |
|
|
|
public FileProjectItem AddDirectory(string include) |
|
{ |
|
var fileProjectItem = new FileProjectItem(this, ItemType.Folder, include); |
|
ProjectService.AddProjectItem(this, fileProjectItem); |
|
return fileProjectItem; |
|
} |
|
|
|
public override string AssemblyName { |
|
get { return assemblyName; } |
|
set { assemblyName = value; } |
|
} |
|
|
|
public override string RootNamespace { |
|
get { return rootNamespace; } |
|
set { rootNamespace = value; } |
|
} |
|
} |
|
}
|
|
|