Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit e9bd802

Browse files
authored
Merge pull request #543 from ServiceStack/netcore
Update tests to .NET Core 1.1 fix warnings
2 parents 9373ef2 + cd30314 commit e9bd802

File tree

53 files changed

+236
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+236
-202
lines changed

src/ServiceStack.OrmLite.PostgreSQL.Tests/Expressions/AuthorUseCase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public void AuthorUsesCases()
304304
bool r6 = db.Scalar<Author, bool>(e => Sql.Max(e.Active));
305305
Assert.AreEqual(expectedBool, r6);
306306
}
307-
catch (Exception e)
307+
catch (Exception)
308308
{
309309
//????
310310
//if (dialect.Name == "PostgreSQL")

src/ServiceStack.OrmLite.PostgreSQL.Tests/ForeignKeyAttributeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class ForeignKeyAttributeTests : OrmLiteTestBase
99
{
1010
public ForeignKeyAttributeTests() : base(Dialect.PostgreSql) { }
1111

12-
[TestFixtureSetUp]
12+
[OneTimeSetUp]
1313
public void Setup()
1414
{
1515
DropTables();
@@ -20,7 +20,7 @@ public void Setup()
2020
}
2121
}
2222

23-
[TestFixtureTearDown]
23+
[OneTimeTearDown]
2424
public void TearDown()
2525
{
2626
DropTables();

src/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteCreateTableWithNamigStrategyTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void Can_get_data_from_TableWithNamigStrategy_AfterChangingNamingStrategy
128128

129129
}
130130

131-
public class PrefixNamingStrategy : OrmLiteNamingStrategyBase
131+
internal class PrefixNamingStrategy : OrmLiteNamingStrategyBase
132132
{
133133

134134
public string TablePrefix { get; set; }
@@ -147,7 +147,7 @@ public override string GetColumnName(string name)
147147

148148
}
149149

150-
public class LowercaseNamingStrategy : OrmLiteNamingStrategyBase
150+
internal class LowercaseNamingStrategy : OrmLiteNamingStrategyBase
151151
{
152152

153153
public override string GetTableName(string name)
@@ -162,7 +162,7 @@ public override string GetColumnName(string name)
162162

163163
}
164164

165-
public class UnderscoreSeparatedCompoundNamingStrategy : OrmLiteNamingStrategyBase
165+
internal class UnderscoreSeparatedCompoundNamingStrategy : OrmLiteNamingStrategyBase
166166
{
167167

168168
public override string GetTableName(string name)

src/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteGetScalarTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void Can_get_scalar_value(){
199199
}
200200

201201

202-
public class Author
202+
internal class Author
203203
{
204204
public Author(){}
205205

src/ServiceStack.OrmLite.PostgreSQL.Tests/OrmLiteInsertTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ public void Can_retrieve_LastInsertId_from_inserted_table()
113113
var row2 = new ModelWithIdAndName1() { Name = "B", Id = 5 };
114114

115115
var row1LastInsertId = db.Insert(row1, selectIdentity: true);
116-
Assert.That(db.GetLastSql(), Is.StringMatching("\\) RETURNING \"?[Ii]d"));
116+
Assert.That(db.GetLastSql(), Does.Match("\\) RETURNING \"?[Ii]d"));
117117

118118
var row2LastInsertId = db.Insert(row2, selectIdentity: true);
119-
Assert.That(db.GetLastSql(), Is.StringMatching("\\) RETURNING \"?[Ii]d"));
119+
Assert.That(db.GetLastSql(), Does.Match("\\) RETURNING \"?[Ii]d"));
120120

121121
var insertedRow1 = db.SingleById<ModelWithIdAndName1>(row1LastInsertId);
122122
var insertedRow2 = db.SingleById<ModelWithIdAndName1>(row2LastInsertId);
@@ -138,10 +138,10 @@ public void Can_retrieve_LastInsertId_from_inserted_table_with_LastVal()
138138
var row2 = ModelWithIdAndName.Create(6);
139139

140140
var row1LastInsertId = db.Insert(row1, selectIdentity: true);
141-
Assert.That(db.GetLastSql(), Is.StringEnding("; SELECT LASTVAL()"));
141+
Assert.That(db.GetLastSql(), Does.EndWith("; SELECT LASTVAL()"));
142142

143143
var row2LastInsertId = db.Insert(row2, selectIdentity: true);
144-
Assert.That(db.GetLastSql(), Is.StringEnding("; SELECT LASTVAL()"));
144+
Assert.That(db.GetLastSql(), Does.EndWith("; SELECT LASTVAL()"));
145145

146146
var insertedRow1 = db.SingleById<ModelWithIdAndName>(row1LastInsertId);
147147
var insertedRow2 = db.SingleById<ModelWithIdAndName>(row2LastInsertId);

src/ServiceStack.OrmLite.PostgreSQL.Tests/project.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"Microsoft.NETCore.App": {
2121
"type": "platform",
22-
"version": "1.0.0"
22+
"version": "1.1.0"
2323
},
2424
"NUnitLite" : "3.5.0",
2525
"ServiceStack.OrmLite" : "1.0.*",
@@ -29,15 +29,15 @@
2929
"ServiceStack.OrmLite.Tests" : "1.0.*"
3030
},
3131
"frameworks": {
32-
"netcoreapp1.0": {
32+
"netcoreapp1.1": {
3333
"imports": "dnxcore50",
3434
"dependencies" : {
35-
"System.Runtime" : "4.1.0",
36-
"System.Runtime.Serialization.Xml" : "4.1.1",
37-
"System.Reflection" : "4.1.0",
38-
"System.Reflection.Primitives" : "4.0.1",
39-
"System.Runtime.Serialization.Primitives": "4.1.1",
40-
"System.Threading.Thread" : "4.0.0"
35+
"System.Runtime" : "4.*",
36+
"System.Runtime.Serialization.Xml" : "4.*",
37+
"System.Reflection" : "4.*",
38+
"System.Reflection.Primitives" : "4.*",
39+
"System.Runtime.Serialization.Primitives": "4.*",
40+
"System.Threading.Thread" : "4.*"
4141
}
4242
}
4343
}

src/ServiceStack.OrmLite.PostgreSQL/Converters/PostrgreSqlFloatConverters.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,5 @@ public class PostrgreSqlDecimalConverter : DecimalConverter
2222
{
2323
public PostrgreSqlDecimalConverter()
2424
: base(38, 6) {}
25-
26-
public virtual string GetColumnDefinition(int? precision, int? scale)
27-
{
28-
return "NUMERIC({0},{1})".Fmt(
29-
precision.GetValueOrDefault(Precision),
30-
scale.GetValueOrDefault(Scale));
31-
}
3225
}
3326
}

src/ServiceStack.OrmLite.SqlServer/SqlServer2012OrmLiteDialectProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ServiceStack.OrmLite.SqlServer
66
{
77
public class SqlServer2012OrmLiteDialectProvider : SqlServerOrmLiteDialectProvider
88
{
9-
public static SqlServer2012OrmLiteDialectProvider Instance = new SqlServer2012OrmLiteDialectProvider();
9+
public static new SqlServer2012OrmLiteDialectProvider Instance = new SqlServer2012OrmLiteDialectProvider();
1010

1111
public override string ToSelectStatement(ModelDefinition modelDef,
1212
string selectExpression,

tests/ServiceStack.OrmLite.SqliteTests/project.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"Microsoft.NETCore.App": {
2121
"type": "platform",
22-
"version": "1.0.0"
22+
"version": "1.1.0"
2323
},
2424
"NUnitLite" : "3.5.0",
2525
"ServiceStack.OrmLite" : "1.0.*",
@@ -28,14 +28,14 @@
2828
"ServiceStack.OrmLite.Sqlite" : "1.0.*"
2929
},
3030
"frameworks": {
31-
"netcoreapp1.0": {
31+
"netcoreapp1.1": {
3232
"imports": "dnxcore50",
3333
"dependencies" : {
34-
"System.Runtime" : "4.1.0",
35-
"System.Runtime.Serialization.Xml" : "4.1.1",
36-
"System.Reflection" : "4.1.0",
37-
"System.Reflection.Primitives" : "4.0.1",
38-
"System.Runtime.Serialization.Primitives": "4.1.1"
34+
"System.Runtime" : "4.*",
35+
"System.Runtime.Serialization.Xml" : "4.*",
36+
"System.Reflection" : "4.*",
37+
"System.Reflection.Primitives" : "4.*",
38+
"System.Runtime.Serialization.Primitives": "4.*"
3939
}
4040
}
4141
}

tests/ServiceStack.OrmLite.Tests/Async/AsyncTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public async Task Does_throw_async_errors()
5151
}
5252
catch (Exception ex)
5353
{
54-
Assert.That(ex.Message.ToLower(), Is.StringContaining("id")
55-
.Or.StringContaining("notexists")
56-
.Or.StringContaining("not_exists"));
54+
Assert.That(ex.Message.ToLower(), Does.Contain("id")
55+
.Or.Contain("notexists")
56+
.Or.Contain("not_exists"));
5757
}
5858

5959
try
@@ -63,9 +63,9 @@ public async Task Does_throw_async_errors()
6363
}
6464
catch (Exception ex)
6565
{
66-
Assert.That(ex.Message.ToLower(), Is.StringContaining("id")
67-
.Or.StringContaining("notexists")
68-
.Or.StringContaining("not_exists"));
66+
Assert.That(ex.Message.ToLower(), Does.Contain("id")
67+
.Or.Contain("notexists")
68+
.Or.Contain("not_exists"));
6969
}
7070

7171
try
@@ -79,9 +79,9 @@ await db.InsertAllAsync(new[] {
7979
catch (Exception ex)
8080
{
8181
var innerEx = ex.UnwrapIfSingleException();
82-
Assert.That(innerEx.Message.ToLower(), Is.StringContaining("id")
83-
.Or.StringContaining("notexists")
84-
.Or.StringContaining("not_exists"));
82+
Assert.That(innerEx.Message.ToLower(), Does.Contain("id")
83+
.Or.Contain("notexists")
84+
.Or.Contain("not_exists"));
8585
}
8686

8787
try
@@ -95,9 +95,9 @@ await db.UpdateAllAsync(new[] {
9595
catch (Exception ex)
9696
{
9797
var innerEx = ex.UnwrapIfSingleException();
98-
Assert.That(innerEx.Message.ToLower(), Is.StringContaining("id")
99-
.Or.StringContaining("notexists")
100-
.Or.StringContaining("not_exists"));
98+
Assert.That(innerEx.Message.ToLower(), Does.Contain("id")
99+
.Or.Contain("notexists")
100+
.Or.Contain("not_exists"));
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)