Remove legacy projects
This commit is contained in:
@@ -2,10 +2,8 @@ using System.Linq;
|
||||
using System.Xml;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.Testing;
|
||||
using Umbraco.Web;
|
||||
|
||||
@@ -13,6 +13,8 @@ using Umbraco.Web.PublishedCache.XmlPublishedCache;
|
||||
using Umbraco.Tests.Testing;
|
||||
using Current = Umbraco.Web.Composing.Current;
|
||||
using LightInject;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
|
||||
namespace Umbraco.Tests.Cache.PublishedCache
|
||||
{
|
||||
@@ -29,16 +31,29 @@ namespace Umbraco.Tests.Cache.PublishedCache
|
||||
.Append<DefaultUrlSegmentProvider>();
|
||||
}
|
||||
|
||||
private IMediaType MakeNewMediaType(IUser user, string text, int parentId = -1)
|
||||
{
|
||||
var mt = new MediaType(parentId) { Name = text, Alias = text, Thumbnail = "icon-folder", Icon = "icon-folder" };
|
||||
ServiceContext.MediaTypeService.Save(mt);
|
||||
return mt;
|
||||
}
|
||||
|
||||
private IMedia MakeNewMedia(string name, IMediaType mediaType, IUser user, int parentId)
|
||||
{
|
||||
var m = ServiceContext.MediaService.CreateMediaWithIdentity(name, parentId, mediaType.Alias);
|
||||
return m;
|
||||
}
|
||||
|
||||
//NOTE: This is "Without_Examine" too
|
||||
[Test]
|
||||
public void Get_Root_Docs()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot1", mType, user, -1);
|
||||
var mRoot2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot2", mType, user, -1);
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot1.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot2.Id);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot1 = MakeNewMedia("MediaRoot1", mType, user, -1);
|
||||
var mRoot2 = MakeNewMedia("MediaRoot2", mType, user, -1);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot1.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot2.Id);
|
||||
|
||||
var ctx = GetUmbracoContext("/test");
|
||||
var cache = new PublishedMediaCache(new XmlStore((XmlDocument) null), ServiceContext.MediaService, ServiceContext.UserService, new StaticCacheProvider(), ContentTypesCache);
|
||||
@@ -52,9 +67,9 @@ namespace Umbraco.Tests.Cache.PublishedCache
|
||||
public void Get_Item_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
|
||||
//var publishedMedia = PublishedMediaTests.GetNode(mRoot.Id, GetUmbracoContext("/test", 1234));
|
||||
var umbracoContext = GetUmbracoContext("/test");
|
||||
@@ -63,15 +78,15 @@ namespace Umbraco.Tests.Cache.PublishedCache
|
||||
Assert.IsNotNull(publishedMedia);
|
||||
|
||||
Assert.AreEqual(mRoot.Id, publishedMedia.Id);
|
||||
Assert.AreEqual(mRoot.CreateDateTime.ToString("dd/MM/yyyy HH:mm:ss"), publishedMedia.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"));
|
||||
Assert.AreEqual(mRoot.User.Id, publishedMedia.CreatorId);
|
||||
Assert.AreEqual(mRoot.User.Name, publishedMedia.CreatorName);
|
||||
Assert.AreEqual(mRoot.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"), publishedMedia.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"));
|
||||
Assert.AreEqual(mRoot.CreatorId, publishedMedia.CreatorId);
|
||||
//Assert.AreEqual(mRoot.User.Name, publishedMedia.CreatorName);
|
||||
Assert.AreEqual(mRoot.ContentType.Alias, publishedMedia.DocumentTypeAlias);
|
||||
Assert.AreEqual(mRoot.ContentType.Id, publishedMedia.DocumentTypeId);
|
||||
Assert.AreEqual(mRoot.Level, publishedMedia.Level);
|
||||
Assert.AreEqual(mRoot.Text, publishedMedia.Name);
|
||||
Assert.AreEqual(mRoot.Name, publishedMedia.Name);
|
||||
Assert.AreEqual(mRoot.Path, publishedMedia.Path);
|
||||
Assert.AreEqual(mRoot.sortOrder, publishedMedia.SortOrder);
|
||||
Assert.AreEqual(mRoot.SortOrder, publishedMedia.SortOrder);
|
||||
Assert.IsNull(publishedMedia.Parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,20 +79,20 @@ namespace Umbraco.Tests.Issues
|
||||
// and now it is OK
|
||||
Assert.AreEqual("alias", aliasName);
|
||||
|
||||
// get the legacy content type
|
||||
var legacyContentType = new umbraco.cms.businesslogic.ContentType(contentType.Id);
|
||||
Assert.AreEqual("test", legacyContentType.Alias);
|
||||
//// get the legacy content type
|
||||
//var legacyContentType = new umbraco.cms.businesslogic.ContentType(contentType.Id);
|
||||
//Assert.AreEqual("test", legacyContentType.Alias);
|
||||
|
||||
// get the legacy properties
|
||||
var legacyProperties = legacyContentType.PropertyTypes;
|
||||
//// get the legacy properties
|
||||
//var legacyProperties = legacyContentType.PropertyTypes;
|
||||
|
||||
// without the fix, due to some (swallowed) inner exception, we have no properties
|
||||
//Assert.IsNull(legacyProperties);
|
||||
//// without the fix, due to some (swallowed) inner exception, we have no properties
|
||||
////Assert.IsNull(legacyProperties);
|
||||
|
||||
// thanks to the fix, it works
|
||||
Assert.IsNotNull(legacyProperties);
|
||||
Assert.AreEqual(1, legacyProperties.Count);
|
||||
Assert.AreEqual("prop", legacyProperties[0].Alias);
|
||||
//// thanks to the fix, it works
|
||||
//Assert.IsNotNull(legacyProperties);
|
||||
//Assert.AreEqual(1, legacyProperties.Count);
|
||||
//Assert.AreEqual("prop", legacyProperties[0].Alias);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Web.Caching;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Profiling;
|
||||
using umbraco;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Macros;
|
||||
using File = System.IO.File;
|
||||
using Macro = umbraco.cms.businesslogic.macro.Macro;
|
||||
using Current = Umbraco.Core.Composing.Current;
|
||||
|
||||
namespace Umbraco.Tests.Macros
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using Moq;
|
||||
using NPoco;
|
||||
using NUnit.Framework;
|
||||
using Semver;
|
||||
using SQLCE4Umbraco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
@@ -59,7 +58,7 @@ namespace Umbraco.Tests.Migrations.Upgrades
|
||||
public override void DatabaseSpecificTearDown()
|
||||
{
|
||||
//legacy API database connection close
|
||||
SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
//SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
}
|
||||
|
||||
public override IUmbracoDatabase GetConfiguredDatabase()
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.IO;
|
||||
using Moq;
|
||||
using NPoco;
|
||||
using NUnit.Framework;
|
||||
using SQLCE4Umbraco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
@@ -22,6 +21,9 @@ namespace Umbraco.Tests.Migrations.Upgrades
|
||||
{
|
||||
string filePath = string.Concat(Path, "\\UmbracoNPocoTests.sdf");
|
||||
|
||||
// no more "clear database" just recreate it
|
||||
if (File.Exists(filePath)) File.Delete(filePath);
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
try
|
||||
@@ -50,7 +52,7 @@ namespace Umbraco.Tests.Migrations.Upgrades
|
||||
}
|
||||
else
|
||||
{
|
||||
TestHelper.ClearDatabase();
|
||||
//TestHelper.ClearDatabase();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,9 +60,9 @@ namespace Umbraco.Tests.Migrations.Upgrades
|
||||
public override void DatabaseSpecificTearDown()
|
||||
{
|
||||
//legacy API database connection close
|
||||
SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
//SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
|
||||
TestHelper.ClearDatabase();
|
||||
//TestHelper.ClearDatabase();
|
||||
}
|
||||
|
||||
public override IUmbracoDatabase GetConfiguredDatabase()
|
||||
|
||||
@@ -7,9 +7,7 @@ using System.Text.RegularExpressions;
|
||||
using Moq;
|
||||
using NPoco;
|
||||
using NUnit.Framework;
|
||||
using SQLCE4Umbraco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Migrations.Initial;
|
||||
@@ -86,7 +84,7 @@ namespace Umbraco.Tests.Migrations.Upgrades
|
||||
AppDomain.CurrentDomain.SetData("DataDirectory", null);
|
||||
|
||||
//legacy API database connection close
|
||||
SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
//SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
|
||||
string filePath = string.Concat(Path, "\\UmbracoNPocoTests.sdf");
|
||||
if (File.Exists(filePath))
|
||||
|
||||
@@ -6,18 +6,12 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using SqlCE4Umbraco;
|
||||
using umbraco;
|
||||
|
||||
using umbraco.cms.businesslogic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.uicontrols;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
@@ -41,18 +35,15 @@ namespace Umbraco.Tests.Plugins
|
||||
_manager.AssembliesToScan = new[]
|
||||
{
|
||||
this.GetType().Assembly,
|
||||
typeof(SqlCEHelper).Assembly,
|
||||
typeof(CMSNode).Assembly,
|
||||
typeof(System.Guid).Assembly,
|
||||
typeof(NUnit.Framework.Assert).Assembly,
|
||||
typeof(Microsoft.CSharp.CSharpCodeProvider).Assembly,
|
||||
typeof(System.Xml.NameTable).Assembly,
|
||||
typeof(System.Configuration.GenericEnumConverter).Assembly,
|
||||
typeof(System.Web.SiteMap).Assembly,
|
||||
typeof(TabPage).Assembly,
|
||||
//typeof(TabPage).Assembly,
|
||||
typeof(System.Web.Mvc.ActionResult).Assembly,
|
||||
typeof(TypeFinder).Assembly,
|
||||
typeof(ISqlHelper).Assembly,
|
||||
typeof(UmbracoContext).Assembly
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,20 +11,13 @@ using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.Compilation;
|
||||
using NUnit.Framework;
|
||||
using SqlCE4Umbraco;
|
||||
using umbraco;
|
||||
|
||||
using umbraco.cms.businesslogic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.uicontrols;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.TestHelpers.Stubs;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Models.Trees;
|
||||
using Umbraco.Web.Trees;
|
||||
|
||||
namespace Umbraco.Tests.Plugins
|
||||
@@ -47,18 +40,15 @@ namespace Umbraco.Tests.Plugins
|
||||
_assemblies = new[]
|
||||
{
|
||||
this.GetType().Assembly,
|
||||
typeof(SqlCEHelper).Assembly,
|
||||
typeof(CMSNode).Assembly,
|
||||
typeof(System.Guid).Assembly,
|
||||
typeof(NUnit.Framework.Assert).Assembly,
|
||||
typeof(Microsoft.CSharp.CSharpCodeProvider).Assembly,
|
||||
typeof(System.Xml.NameTable).Assembly,
|
||||
typeof(System.Configuration.GenericEnumConverter).Assembly,
|
||||
typeof(System.Web.SiteMap).Assembly,
|
||||
typeof(TabPage).Assembly,
|
||||
//typeof(TabPage).Assembly,
|
||||
typeof(System.Web.Mvc.ActionResult).Assembly,
|
||||
typeof(TypeFinder).Assembly,
|
||||
typeof(ISqlHelper).Assembly,
|
||||
typeof(global::UmbracoExamine.BaseUmbracoIndexer).Assembly
|
||||
};
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ using UmbracoExamine;
|
||||
using Current = Umbraco.Web.Composing.Current;
|
||||
using Umbraco.Tests.Testing;
|
||||
using LightInject;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
|
||||
namespace Umbraco.Tests.PublishedContent
|
||||
{
|
||||
@@ -42,6 +43,19 @@ namespace Umbraco.Tests.PublishedContent
|
||||
.Append<DefaultUrlSegmentProvider>();
|
||||
}
|
||||
|
||||
private IMediaType MakeNewMediaType(IUser user, string text, int parentId = -1)
|
||||
{
|
||||
var mt = new MediaType(parentId) { Name = text, Alias = text, Thumbnail = "icon-folder", Icon = "icon-folder" };
|
||||
ServiceContext.MediaTypeService.Save(mt);
|
||||
return mt;
|
||||
}
|
||||
|
||||
private IMedia MakeNewMedia(string name, IMediaType mediaType, IUser user, int parentId)
|
||||
{
|
||||
var m = ServiceContext.MediaService.CreateMediaWithIdentity(name, parentId, mediaType.Alias);
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shared with PublishMediaStoreTests
|
||||
/// </summary>
|
||||
@@ -290,16 +304,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public void Children_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child3", mType, user, mRoot.Id);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = MakeNewMedia("Child3", mType, user, mRoot.Id);
|
||||
|
||||
var mSubChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild3", mType, user, mChild1.Id);
|
||||
var mSubChild1 = MakeNewMedia("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = MakeNewMedia("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = MakeNewMedia("SubChild3", mType, user, mChild1.Id);
|
||||
|
||||
var publishedMedia = GetNode(mRoot.Id);
|
||||
var rootChildren = publishedMedia.Children();
|
||||
@@ -314,16 +328,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public void Descendants_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child3", mType, user, mRoot.Id);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = MakeNewMedia("Child3", mType, user, mRoot.Id);
|
||||
|
||||
var mSubChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild3", mType, user, mChild1.Id);
|
||||
var mSubChild1 = MakeNewMedia("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = MakeNewMedia("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = MakeNewMedia("SubChild3", mType, user, mChild1.Id);
|
||||
|
||||
var publishedMedia = GetNode(mRoot.Id);
|
||||
var rootDescendants = publishedMedia.Descendants();
|
||||
@@ -338,16 +352,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public void DescendantsOrSelf_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child3", mType, user, mRoot.Id);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = MakeNewMedia("Child3", mType, user, mRoot.Id);
|
||||
|
||||
var mSubChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild3", mType, user, mChild1.Id);
|
||||
var mSubChild1 = MakeNewMedia("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = MakeNewMedia("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = MakeNewMedia("SubChild3", mType, user, mChild1.Id);
|
||||
|
||||
var publishedMedia = GetNode(mRoot.Id);
|
||||
var rootDescendantsOrSelf = publishedMedia.DescendantsOrSelf();
|
||||
@@ -364,16 +378,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public void Parent_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child3", mType, user, mRoot.Id);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = MakeNewMedia("Child3", mType, user, mRoot.Id);
|
||||
|
||||
var mSubChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild3", mType, user, mChild1.Id);
|
||||
var mSubChild1 = MakeNewMedia("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = MakeNewMedia("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = MakeNewMedia("SubChild3", mType, user, mChild1.Id);
|
||||
|
||||
var publishedRoot = GetNode(mRoot.Id);
|
||||
Assert.AreEqual(null, publishedRoot.Parent);
|
||||
@@ -389,16 +403,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public void Ancestors_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child3", mType, user, mRoot.Id);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = MakeNewMedia("Child3", mType, user, mRoot.Id);
|
||||
|
||||
var mSubChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild3", mType, user, mChild1.Id);
|
||||
var mSubChild1 = MakeNewMedia("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = MakeNewMedia("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = MakeNewMedia("SubChild3", mType, user, mChild1.Id);
|
||||
|
||||
var publishedSubChild1 = GetNode(mSubChild1.Id);
|
||||
Assert.IsTrue(publishedSubChild1.Ancestors().Select(x => x.Id).ContainsAll(new[] { mChild1.Id, mRoot.Id }));
|
||||
@@ -408,16 +422,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
public void AncestorsOrSelf_Without_Examine()
|
||||
{
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var mType = global::umbraco.cms.businesslogic.media.MediaType.MakeNew(user, "TestMediaType");
|
||||
var mRoot = global::umbraco.cms.businesslogic.media.Media.MakeNew("MediaRoot", mType, user, -1);
|
||||
var mType = MakeNewMediaType(user, "TestMediaType");
|
||||
var mRoot = MakeNewMedia("MediaRoot", mType, user, -1);
|
||||
|
||||
var mChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("Child3", mType, user, mRoot.Id);
|
||||
var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id);
|
||||
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot.Id);
|
||||
var mChild3 = MakeNewMedia("Child3", mType, user, mRoot.Id);
|
||||
|
||||
var mSubChild1 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = global::umbraco.cms.businesslogic.media.Media.MakeNew("SubChild3", mType, user, mChild1.Id);
|
||||
var mSubChild1 = MakeNewMedia("SubChild1", mType, user, mChild1.Id);
|
||||
var mSubChild2 = MakeNewMedia("SubChild2", mType, user, mChild1.Id);
|
||||
var mSubChild3 = MakeNewMedia("SubChild3", mType, user, mChild1.Id);
|
||||
|
||||
var publishedSubChild1 = GetNode(mSubChild1.Id);
|
||||
Assert.IsTrue(publishedSubChild1.AncestorsOrSelf().Select(x => x.Id).ContainsAll(
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
using umbraco.cms.businesslogic.template;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Tests.Templates
|
||||
{
|
||||
|
||||
@@ -8,10 +8,8 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using SqlCE4Umbraco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.IO;
|
||||
using umbraco.DataLayer;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Tests.TestHelpers
|
||||
@@ -22,30 +20,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
public static class TestHelper
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Clears an initialized database
|
||||
/// </summary>
|
||||
public static void ClearDatabase()
|
||||
{
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName];
|
||||
var dataHelper = DataLayerHelper.CreateSqlHelper(databaseSettings.ConnectionString, false) as SqlCEHelper;
|
||||
|
||||
if (dataHelper == null)
|
||||
throw new InvalidOperationException("The sql helper for unit tests must be of type SqlCEHelper, check the ensure the connection string used for this test is set to use SQLCE");
|
||||
|
||||
dataHelper.ClearDatabase();
|
||||
}
|
||||
|
||||
public static void DropForeignKeys(string table)
|
||||
{
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName];
|
||||
var dataHelper = DataLayerHelper.CreateSqlHelper(databaseSettings.ConnectionString, false) as SqlCEHelper;
|
||||
|
||||
if (dataHelper == null)
|
||||
throw new InvalidOperationException("The sql helper for unit tests must be of type SqlCEHelper, check the ensure the connection string used for this test is set to use SQLCE");
|
||||
|
||||
dataHelper.DropForeignKeys(table);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current assembly directory.
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Web.Routing;
|
||||
using System.Xml;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using SQLCE4Umbraco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Configuration;
|
||||
@@ -300,7 +299,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
//Ensure that any database connections from a previous test is disposed.
|
||||
//This is really just double safety as its also done in the TearDown.
|
||||
database?.Dispose();
|
||||
SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
//SqlCeContextGuardian.CloseBackgroundConnection();
|
||||
}
|
||||
|
||||
private void RemoveDatabaseFile(IUmbracoDatabase database, Action<Exception> onFail = null)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using umbraco.BusinessLogic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web.UI;
|
||||
using umbraco;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.cms.presentation.user;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Web._Legacy.UI;
|
||||
|
||||
@@ -600,26 +600,10 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SQLCE4Umbraco\SqlCE4Umbraco.csproj">
|
||||
<Project>{5BA5425F-27A7-4677-865E-82246498AA2E}</Project>
|
||||
<Name>SqlCE4Umbraco</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\umbraco.cms\umbraco.cms.csproj">
|
||||
<Project>{CCD75EC3-63DB-4184-B49D-51C1DD337230}</Project>
|
||||
<Name>umbraco.cms</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\umbraco.controls\umbraco.controls.csproj">
|
||||
<Project>{6EDD2061-82F2-461B-BB6E-879245A832DE}</Project>
|
||||
<Name>umbraco.controls</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj">
|
||||
<Project>{31785BC3-256C-4613-B2F5-A1B0BDDED8C1}</Project>
|
||||
<Name>Umbraco.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\umbraco.datalayer\umbraco.datalayer.csproj">
|
||||
<Project>{C7CB79F0-1C97-4B33-BFA7-00731B579AE2}</Project>
|
||||
<Name>umbraco.datalayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
|
||||
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
|
||||
<Name>Umbraco.Web</Name>
|
||||
|
||||
Reference in New Issue
Block a user