Skip to content

Commit 0535a4e

Browse files
committed
Unit test fixes
1 parent 444fdb4 commit 0535a4e

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

src/Libraries/SmartStore.Core/Data/DataSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public virtual bool Load()
206206
this.TenantName = curTenant;
207207
this.TenantPath = tenantPath;
208208

209-
if (File.Exists(filePath))
209+
if (File.Exists(filePath) && !s_TestMode)
210210
{
211211
string text = File.ReadAllText(filePath);
212212
var settings = ParseSettings(text);

src/Libraries/SmartStore.Core/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
[assembly: InternalsVisibleTo("SmartStore.Core.Tests")]
66
[assembly: InternalsVisibleTo("SmartStore.Services.Tests")]
77
[assembly: InternalsVisibleTo("SmartStore.Web.Mvc.Tests")]
8+
[assembly: InternalsVisibleTo("SmartStore.Data.Tests")]

src/Libraries/SmartStore.Core/Utilities/ObjectDumper.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Diagnostics;
43
using System.IO;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
84
using Newtonsoft.Json;
95

106
namespace SmartStore.Core.Utilities

src/Libraries/SmartStore.Data/SmartDbConfiguration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using SmartStore.Core.Infrastructure;
77
using SmartStore.Data.Caching;
88
using System.Web.Hosting;
9-
using SmartStore.Utilities;
10-
using System.Data.Entity.Migrations;
119

1210
namespace SmartStore.Data
1311
{

src/Tests/SmartStore.Data.Tests/GlobalSetup.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Data.Entity;
4-
using System.Linq;
5-
using System.Text;
63
using NUnit.Framework;
7-
using SmartStore.Data.Migrations;
4+
using SmartStore.Core.Data;
85

96
namespace SmartStore.Data.Tests
107
{
@@ -14,6 +11,7 @@ public class GlobalSetup
1411
[SetUp]
1512
public void SetUp()
1613
{
14+
DataSettings.SetTestMode(true);
1715
var ctx = new SmartObjectContext(GetTestDbName());
1816
Database.SetInitializer(new DropCreateDatabaseAlways<SmartObjectContext>());
1917
ctx.Database.Initialize(true);

0 commit comments

Comments
 (0)