From 66ddb21ef8fd915d4fa9a7a6f07974107f4aafb8 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Mon, 6 May 2013 02:03:24 -1000 Subject: [PATCH 1/2] Fixes null check --- src/Umbraco.Core/Persistence/DefaultDatabaseFactory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Persistence/DefaultDatabaseFactory.cs b/src/Umbraco.Core/Persistence/DefaultDatabaseFactory.cs index bf06a66f2b..5228889791 100644 --- a/src/Umbraco.Core/Persistence/DefaultDatabaseFactory.cs +++ b/src/Umbraco.Core/Persistence/DefaultDatabaseFactory.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Persistence //double check if (_nonHttpInstance == null) { - _nonHttpInstance = string.IsNullOrEmpty(_providerName) == false && string.IsNullOrEmpty(_providerName) == false + _nonHttpInstance = string.IsNullOrEmpty(_connectionString) == false && string.IsNullOrEmpty(_providerName) == false ? new UmbracoDatabase(_connectionString, _providerName) : new UmbracoDatabase(_connectionStringName); } @@ -81,7 +81,7 @@ namespace Umbraco.Core.Persistence if (HttpContext.Current.Items.Contains(typeof(DefaultDatabaseFactory)) == false) { HttpContext.Current.Items.Add(typeof (DefaultDatabaseFactory), - string.IsNullOrEmpty(_providerName) == false && string.IsNullOrEmpty(_providerName) == false + string.IsNullOrEmpty(_connectionString) == false && string.IsNullOrEmpty(_providerName) == false ? new UmbracoDatabase(_connectionString, _providerName) : new UmbracoDatabase(_connectionStringName)); } From 938754486509af533c99a962efdd534c2b814b1c Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Mon, 6 May 2013 02:08:38 -1000 Subject: [PATCH 2/2] Fixes test outcome --- src/Umbraco.Tests/TypeFinderTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Tests/TypeFinderTests.cs b/src/Umbraco.Tests/TypeFinderTests.cs index 85b8bc9c9d..7d052d7cbc 100644 --- a/src/Umbraco.Tests/TypeFinderTests.cs +++ b/src/Umbraco.Tests/TypeFinderTests.cs @@ -85,8 +85,8 @@ namespace Umbraco.Tests var originalTypesFound = TypeFinderOriginal.FindClassesOfType(_assemblies); Assert.AreEqual(originalTypesFound.Count(), typesFound.Count()); - Assert.AreEqual(4, typesFound.Count()); - Assert.AreEqual(4, originalTypesFound.Count()); + Assert.AreEqual(6, typesFound.Count()); + Assert.AreEqual(6, originalTypesFound.Count()); } [Test]