mirror of https://github.com/Squidex/squidex.git
committed by
GitHub
26 changed files with 320 additions and 101 deletions
@ -0,0 +1,28 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using System; |
|||
using System.IO; |
|||
|
|||
namespace Squidex.Infrastructure.Assets |
|||
{ |
|||
public sealed class DelegateAssetFile : AssetFile |
|||
{ |
|||
private readonly Func<Stream> openStream; |
|||
|
|||
public DelegateAssetFile(string fileName, string mimeType, long fileSize, Func<Stream> openStream) |
|||
: base(fileName, mimeType, fileSize) |
|||
{ |
|||
this.openStream = openStream; |
|||
} |
|||
|
|||
public override Stream OpenRead() |
|||
{ |
|||
return openStream(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using System.IO; |
|||
using Squidex.Infrastructure.Assets; |
|||
|
|||
namespace Squidex.Domain.Apps.Entities.TestHelpers |
|||
{ |
|||
public sealed class NoopAssetFile : AssetFile |
|||
{ |
|||
public NoopAssetFile(string fileName = "image.png", string mimeType = "image/png", long fileSize = 1024) |
|||
: base(fileName, mimeType, fileSize) |
|||
{ |
|||
} |
|||
|
|||
public override Stream OpenRead() |
|||
{ |
|||
return new MemoryStream(); |
|||
} |
|||
} |
|||
} |
|||
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in new issue