mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Updating NuGet integration
Using latest version Namespace change from NuPack to NuGet Adding tests for package creation --HG-- branch : nuget extra : transplant_source : H%D0%91G%21%E4%22x%00%B6eX%8E%98%04%FE%2B%B57%28
This commit is contained in:
@@ -245,6 +245,7 @@
|
||||
<Compile Include="Mvc\Routes\UrlPrefixTests.cs" />
|
||||
<Compile Include="Records\BigRecord.cs" />
|
||||
<Compile Include="Scripting\ScriptingTests.cs" />
|
||||
<Compile Include="Stubs\InMemoryWebSiteFolder.cs" />
|
||||
<Compile Include="Stubs\StubWorkContextAccessor.cs" />
|
||||
<Compile Include="Stubs\StubExtensionManager.cs" />
|
||||
<Compile Include="Stubs\StubReportsCoordinator.cs" />
|
||||
|
57
src/Orchard.Tests/Stubs/InMemoryWebSiteFolder.cs
Normal file
57
src/Orchard.Tests/Stubs/InMemoryWebSiteFolder.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Orchard.Caching;
|
||||
using Orchard.FileSystems.WebSite;
|
||||
|
||||
namespace Orchard.Tests.Stubs {
|
||||
public class InMemoryWebSiteFolder : IWebSiteFolder {
|
||||
Dictionary<string, string> _contents = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public void AddFile(string virtualPath, string contents) {
|
||||
_contents[Canonical(virtualPath)] = contents;
|
||||
}
|
||||
|
||||
private string Canonical(string virtualPath) {
|
||||
return virtualPath.Replace("\\", "/");
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListDirectories(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListFiles(string virtualPath, bool recursive) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool FileExists(string virtualPath) {
|
||||
return _contents.ContainsKey(virtualPath);
|
||||
}
|
||||
|
||||
public string ReadFile(string virtualPath) {
|
||||
string value;
|
||||
return _contents.TryGetValue(Canonical(virtualPath), out value) ? value : null;
|
||||
}
|
||||
|
||||
public string ReadFile(string virtualPath, bool actualContent) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void CopyFileTo(string virtualPath, Stream destination) {
|
||||
string value;
|
||||
if (_contents.TryGetValue(Canonical(virtualPath), out value)) {
|
||||
var bytes = Encoding.Default.GetBytes(value);
|
||||
destination.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IVolatileToken WhenPathChanges(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user