mirror of https://github.com/Squidex/squidex.git
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.
65 lines
1.8 KiB
65 lines
1.8 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using Squidex.Domain.Apps.Core.Assets;
|
|
using Squidex.Domain.Apps.Core.ValidateContent;
|
|
using Squidex.Infrastructure;
|
|
|
|
namespace Squidex.Domain.Apps.Core.TestHelpers
|
|
{
|
|
public static class TestAssets
|
|
{
|
|
public sealed class AssetInfo : IAssetInfo
|
|
{
|
|
public DomainId AssetId { get; set; }
|
|
|
|
public string FileName { get; set; }
|
|
|
|
public string FileHash { get; set; }
|
|
|
|
public string Slug { get; set; }
|
|
|
|
public long FileSize { get; set; }
|
|
|
|
public bool IsImage { get; set; }
|
|
|
|
public int? PixelWidth { get; set; }
|
|
|
|
public int? PixelHeight { get; set; }
|
|
|
|
public AssetMetadata Metadata { get; set; }
|
|
|
|
public AssetType Type { get; set; }
|
|
}
|
|
|
|
public static AssetInfo Document(DomainId id)
|
|
{
|
|
return new AssetInfo
|
|
{
|
|
AssetId = id,
|
|
FileName = "MyDocument.pdf",
|
|
FileSize = 1024 * 4,
|
|
Type = AssetType.Unknown
|
|
};
|
|
}
|
|
|
|
public static AssetInfo Image(DomainId id)
|
|
{
|
|
return new AssetInfo
|
|
{
|
|
AssetId = id,
|
|
FileName = "MyImage.png",
|
|
FileSize = 1024 * 8,
|
|
Type = AssetType.Image,
|
|
Metadata =
|
|
new AssetMetadata()
|
|
.SetPixelWidth(800)
|
|
.SetPixelHeight(600)
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|