Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up of constant strings, and removing a table create that is not…

… used.
  • Loading branch information...
commit fd7c347e64fc331d2d3a2c05c85a58ce863c8bb7 1 parent deb1370
@haeal authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 Dapper.Contrib.Tests/SqlCeTests.cs
View
11 Dapper.Contrib.Tests/SqlCeTests.cs
@@ -13,6 +13,7 @@ class SqlCeTests : Tests
{
private readonly string _assemblyLocation;
private readonly string _projFolder;
+ private const string DatabaseFilename = "Test.sdf";
private bool _setUp;
public SqlCeTests()
@@ -32,7 +33,7 @@ protected override string ConnectionString
{
get
{
- return "Data Source = " + _projFolder + "\\Test.sdf;";
+ return string.Format("Data Source = {0}\\{1};", _projFolder, DatabaseFilename);
}
}
@@ -41,9 +42,10 @@ public override void SetUpTests()
if (_setUp)
return;
- if (File.Exists(_projFolder + "\\Test.sdf"))
- File.Delete(_projFolder + "\\Test.sdf");
- var connectionString = "Data Source = " + _projFolder + "\\Test.sdf;";
+ string fullPath = Path.Combine(_projFolder, DatabaseFilename);
+ if (File.Exists(fullPath))
+ File.Delete(fullPath);
+ var connectionString = ConnectionString;
var engine = new SqlCeEngine(connectionString);
engine.CreateDatabase();
@@ -52,7 +54,6 @@ public override void SetUpTests()
connection.Open();
connection.Execute(@" create table Users (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null, Age int not null) ");
connection.Execute(@" create table Automobiles (Id int IDENTITY(1,1) not null, Name nvarchar(100) not null) ");
- connection.Execute(@" create table Houses (Id int not null, Number int not null, Road nvarchar(100) not null) ");
}
_setUp = true;
}

0 comments on commit fd7c347

Please sign in to comment.
Something went wrong with that request. Please try again.