public void Should_generate_url_with_id_and_version()
        {
            sut.GeneratePublicUrl(id, 1, string.Empty);

            A.CallTo(() => sut.GeneratePublicUrl($"{id}_1"))
            .MustHaveHappened();
        }
        public void Should_get_public_url_from_store()
        {
            var url = "http_//squidex.io/assets";

            A.CallTo(() => assetStore.GeneratePublicUrl(fileNameNew))
            .Returns(url);

            var result = sut.GeneratePublicUrl(appId, assetId, assetFileVersion);

            Assert.Equal(url, result);
        }
Пример #3
0
        public void Should_invoke_asset_store_to_generate_public_url()
        {
            var url = "http_//squidex.io/assets";

            A.CallTo(() => assetStore.GeneratePublicUrl(fileName))
            .Returns(url);

            var result = sut.GeneratePublicUrl(assetId, assetFileVersion);

            Assert.Equal(url, result);
        }
Пример #4
0
        public void Should_get_public_url_from_store(bool folderPerApp, string?suffix, string fileName)
        {
            var fullName = GetFullName(fileName);

            options.FolderPerApp = folderPerApp;

            var url = "http_//squidex.io/assets";

            A.CallTo(() => assetStore.GeneratePublicUrl(fullName))
            .Returns(url);

            var result = sut.GeneratePublicUrl(appId, assetId, assetFileVersion, suffix);

            Assert.Equal(url, result);
        }
        public string?GeneratePublicUrl(DomainId appId, DomainId id, long fileVersion)
        {
            var fileName = GetFileName(appId, id, fileVersion);

            return(assetStore.GeneratePublicUrl(fileName));
        }
Пример #6
0
        public string?GeneratePublicUrl(Guid id, long fileVersion)
        {
            var fileName = GetFileName(id, fileVersion);

            return(assetStore.GeneratePublicUrl(fileName));
        }
 public static string GeneratePublicUrl(this IAssetStore store, string id, long version, string suffix)
 {
     return(store.GeneratePublicUrl(GetFileName(id, version, suffix)));
 }
 public static string GeneratePublicUrl(this IAssetStore store, Guid id, long version, string suffix)
 {
     return(store.GeneratePublicUrl(id.ToString(), version, suffix));
 }
Пример #9
0
 public string?GenerateAssetSourceUrl(IAppEntity app, IAssetEntity asset)
 {
     return(assetStore.GeneratePublicUrl(asset.Id.ToString(), asset.FileVersion, null));
 }