Added moq (need to replace all rhino mock later) allowing us to nicely mock umbraco settings, fixing up more unit tests.
This commit is contained in:
@@ -23,13 +23,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
var autoFill = this[prop] as ConfigurationElementCollection;
|
||||
if (autoFill != null && autoFill.ElementInformation.IsPresent == false)
|
||||
{
|
||||
_defaultCollection = new NotDynamicXmlDocumentElementCollection
|
||||
{
|
||||
new NotDynamicXmlDocumentElement {RawValue = "p"},
|
||||
new NotDynamicXmlDocumentElement {RawValue = "div"},
|
||||
new NotDynamicXmlDocumentElement {RawValue = "ul"},
|
||||
new NotDynamicXmlDocumentElement {RawValue = "span"}
|
||||
};
|
||||
_defaultCollection = GetDefaultNotDynamicXmlDocuments();
|
||||
|
||||
//must return the collection directly
|
||||
return _defaultCollection;
|
||||
@@ -39,6 +33,17 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
}
|
||||
}
|
||||
|
||||
internal static NotDynamicXmlDocumentElementCollection GetDefaultNotDynamicXmlDocuments()
|
||||
{
|
||||
return new NotDynamicXmlDocumentElementCollection
|
||||
{
|
||||
new NotDynamicXmlDocumentElement {RawValue = "p"},
|
||||
new NotDynamicXmlDocumentElement {RawValue = "div"},
|
||||
new NotDynamicXmlDocumentElement {RawValue = "ul"},
|
||||
new NotDynamicXmlDocumentElement {RawValue = "span"}
|
||||
};
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof (RazorStaticMappingCollection), AddItemName = "mapping")]
|
||||
[ConfigurationProperty("dataTypeModelStaticMappings", IsDefaultCollection = true)]
|
||||
internal RazorStaticMappingCollection DataTypeModelStaticMappings
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
@@ -92,7 +93,14 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
return _defaultRepositories;
|
||||
}
|
||||
|
||||
return (RepositoriesElement)base["repositories"];
|
||||
//now we need to ensure there is *always* our umbraco repo! its hard coded in the codebase!
|
||||
var reposElement = (RepositoriesElement)base["repositories"];
|
||||
if (reposElement.Repositories.All(x => x.Id != new Guid("65194810-1f85-11dd-bd0b-0800200c9a66")))
|
||||
{
|
||||
reposElement.Repositories.Add(new RepositoryElement() { Name = "Umbraco package Repository", Id = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66") });
|
||||
}
|
||||
|
||||
return reposElement;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user