diff --git a/src/Umbraco.Tests/MediaFactoryTests.cs b/src/Umbraco.Tests/MediaFactoryTests.cs deleted file mode 100644 index 99e07cc1b1..0000000000 --- a/src/Umbraco.Tests/MediaFactoryTests.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Moq; -using NUnit.Framework; -using Umbraco.Core; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.media; -using Umbraco.Core.Cache; -using Umbraco.Core.Logging; -using Umbraco.Core.Profiling; - -namespace Umbraco.Tests -{ - [TestFixture] - public class MediaFactoryTests - { - [SetUp] - public void Initialize() - { - var logger = new ProfilingLogger(Mock.Of(), Mock.Of()); - //this ensures its reset - PluginManager.Current = new PluginManager(new ActivatorServiceProvider(), new NullCacheProvider(), - logger, - false) - { - AssembliesToScan = new[] - { - this.GetType().Assembly - } - }; - - //for testing, we'll specify which assemblies are scanned for the PluginTypeResolver - } - - [TearDown] - public void TearDown() - { - PluginManager.Current = null; - } - - - #region Classes for tests - public class MediaFactory1 : IMediaFactory - { - public List Extensions - { - get { throw new NotImplementedException(); } - } - - public int Priority - { - get { return 1; } - } - - public bool CanHandleMedia(int parentNodeId, PostedMediaFile postedFile, User user) - { - throw new NotImplementedException(); - } - - public Media HandleMedia(int parentNodeId, PostedMediaFile postedFile, User user) - { - throw new NotImplementedException(); - } - - public Media HandleMedia(int parentNodeId, PostedMediaFile postedFile, User user, bool replaceExisting) - { - throw new NotImplementedException(); - } - } - - public class MediaFactory2 : IMediaFactory - { - public List Extensions - { - get { throw new NotImplementedException(); } - } - - public int Priority - { - get { return 2; } - } - - public bool CanHandleMedia(int parentNodeId, PostedMediaFile postedFile, User user) - { - throw new NotImplementedException(); - } - - public Media HandleMedia(int parentNodeId, PostedMediaFile postedFile, User user) - { - throw new NotImplementedException(); - } - - public Media HandleMedia(int parentNodeId, PostedMediaFile postedFile, User user, bool replaceExisting) - { - throw new NotImplementedException(); - } - } - #endregion - } -} \ No newline at end of file diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index 11cabc6d6a..f70686e796 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -513,7 +513,6 @@ - diff --git a/src/umbraco.cms/PluginManagerExtensions.cs b/src/umbraco.cms/PluginManagerExtensions.cs index 63702a2ead..ba2d8c2a01 100644 --- a/src/umbraco.cms/PluginManagerExtensions.cs +++ b/src/umbraco.cms/PluginManagerExtensions.cs @@ -33,18 +33,5 @@ namespace umbraco.cms return resolver.ResolveTypes(); } - /// - /// Returns all available IMediaFactory in application - /// - /// - /// - [Obsolete("We don't use IMediaFactory anymore, we need to remove this when we remove the MediaFactory instance that uses this method")] - internal static IEnumerable ResolveMediaFactories(this PluginManager resolver) - { - return resolver.ResolveTypes(); - } - - - } } \ No newline at end of file diff --git a/src/umbraco.cms/businesslogic/media/IMediaFactory.cs b/src/umbraco.cms/businesslogic/media/IMediaFactory.cs deleted file mode 100644 index 8f8f87556e..0000000000 --- a/src/umbraco.cms/businesslogic/media/IMediaFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.BusinessLogic; - -namespace umbraco.cms.businesslogic.media -{ - [Obsolete("This interface is no longer used and will be removed from the codebase in future versions")] - public interface IMediaFactory - { - List Extensions { get; } - int Priority { get; } - - bool CanHandleMedia(int parentNodeId, PostedMediaFile postedFile, User user); - - Media HandleMedia(int parentNodeId, PostedMediaFile postedFile, User user); - - [Obsolete("Use HandleMedia(int, PostedMediaFile, User) and set the ReplaceExisting property on PostedMediaFile instead")] - Media HandleMedia(int parentNodeId, PostedMediaFile postedFile, User user, bool replaceExisting); - } -} diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index ca3ec22b04..c2f28c52bd 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -177,7 +177,6 @@ - True