Add support for looking up 3rd party editor file paths
Adds a file resolver on the mediaHelper, property editors can then register a resolver to return file paths from whatever format
This commit is contained in:
@@ -11,24 +11,6 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
[Test]
|
||||
public override void ImageCrops()
|
||||
{
|
||||
Assert.IsFalse(SettingsSection.Content.ImageCrops.SaveFiles);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public override void ImageCropItem()
|
||||
{
|
||||
Assert.AreEqual(0, SettingsSection.Content.ImageCrops.Crops.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public override void ImageCropSizes()
|
||||
{
|
||||
Assert.AreEqual(0, SettingsSection.Content.ImageCrops.Crops.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public override void DisableHtmlEmail()
|
||||
{
|
||||
|
||||
@@ -11,59 +11,6 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
|
||||
[TestFixture]
|
||||
public class ContentElementTests : UmbracoSettingsTests
|
||||
{
|
||||
[Test]
|
||||
public virtual void ImageCrops()
|
||||
{
|
||||
Assert.AreEqual(true, SettingsSection.Content.ImageCrops.SaveFiles);
|
||||
Assert.AreEqual(2, SettingsSection.Content.ImageCrops.Crops.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public virtual void ImageCropItem()
|
||||
{
|
||||
Assert.AreEqual("image", SettingsSection.Content.ImageCrops.Crops.First().MediaTypeAlias);
|
||||
Assert.AreEqual("umbracoFocalPoint", SettingsSection.Content.ImageCrops.Crops.First().FocalPointProperty);
|
||||
Assert.AreEqual(3, SettingsSection.Content.ImageCrops.Crops.First().CropSizes.Count());
|
||||
|
||||
Assert.AreEqual("custom", SettingsSection.Content.ImageCrops.Crops.Last().MediaTypeAlias);
|
||||
Assert.AreEqual("customPoint", SettingsSection.Content.ImageCrops.Crops.Last().FocalPointProperty);
|
||||
Assert.AreEqual(2, SettingsSection.Content.ImageCrops.Crops.Last().CropSizes.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public virtual void ImageCropSizes()
|
||||
{
|
||||
var toVerify1 = new List<Tuple<string, int, int>>
|
||||
{
|
||||
new Tuple<string, int, int>("thumb", 100, 100),
|
||||
new Tuple<string, int, int>("portrait", 320, 400),
|
||||
new Tuple<string, int, int>("banner", 620, 140),
|
||||
};
|
||||
var toVerify2 = new List<Tuple<string, int, int>>
|
||||
{
|
||||
new Tuple<string, int, int>("thumb", 100, 100),
|
||||
new Tuple<string, int, int>("banner", 600, 100),
|
||||
};
|
||||
|
||||
for (var i = 0; i < SettingsSection.Content.ImageCrops.Crops.First().CropSizes.Count(); i++)
|
||||
{
|
||||
var size = SettingsSection.Content.ImageCrops.Crops.First().CropSizes.ElementAt(i);
|
||||
var verify = toVerify1[i];
|
||||
Assert.AreEqual(verify.Item1, size.Alias);
|
||||
Assert.AreEqual(verify.Item2, size.Width);
|
||||
Assert.AreEqual(verify.Item3, size.Height);
|
||||
}
|
||||
for (var i = 0; i < SettingsSection.Content.ImageCrops.Crops.Last().CropSizes.Count(); i++)
|
||||
{
|
||||
var size = SettingsSection.Content.ImageCrops.Crops.Last().CropSizes.ElementAt(i);
|
||||
var verify = toVerify2[i];
|
||||
Assert.AreEqual(verify.Item1, size.Alias);
|
||||
Assert.AreEqual(verify.Item2, size.Width);
|
||||
Assert.AreEqual(verify.Item3, size.Height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EmailAddress()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user