Commit b0cd0ef8 authored by Nick Craver's avatar Nick Craver

Fix unit tests after #420

parent 5c5eae8e
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
using System.Linq; using System.Linq;
using Dapper.Contrib.Extensions; using Dapper.Contrib.Extensions;
using Xunit;
#if COREFX #if COREFX
using System.Reflection; using System.Reflection;
...@@ -15,6 +14,8 @@ ...@@ -15,6 +14,8 @@
#endif #endif
#if XUNIT2 #if XUNIT2
using FactAttribute = Dapper.Tests.Contrib.SkippableFactAttribute; using FactAttribute = Dapper.Tests.Contrib.SkippableFactAttribute;
#else
using Xunit;
#endif #endif
namespace Dapper.Tests.Contrib namespace Dapper.Tests.Contrib
...@@ -108,7 +109,7 @@ public void Issue418() ...@@ -108,7 +109,7 @@ public void Issue418()
{ {
//update first (will fail) then insert //update first (will fail) then insert
//added for bug #418 //added for bug #418
var updateObject = new ObjectX() var updateObject = new ObjectX
{ {
ObjectXId = Guid.NewGuid().ToString(), ObjectXId = Guid.NewGuid().ToString(),
Name = "Someone" Name = "Someone"
...@@ -119,12 +120,12 @@ public void Issue418() ...@@ -119,12 +120,12 @@ public void Issue418()
connection.DeleteAll<ObjectX>(); connection.DeleteAll<ObjectX>();
var objectXId = Guid.NewGuid().ToString(); var objectXId = Guid.NewGuid().ToString();
var insertObject = new ObjectX() var insertObject = new ObjectX
{ {
ObjectXId = objectXId, ObjectXId = objectXId,
Name = "Someone else" Name = "Someone else"
}; };
var inserts = connection.Insert(insertObject); connection.Insert(insertObject);
var list = connection.GetAll<ObjectX>(); var list = connection.GetAll<ObjectX>();
list.Count().IsEqualTo(1); list.Count().IsEqualTo(1);
} }
...@@ -181,8 +182,9 @@ public void GetAllWithExplicitKey() ...@@ -181,8 +182,9 @@ public void GetAllWithExplicitKey()
var o1 = new ObjectX { ObjectXId = guid, Name = "Foo" }; var o1 = new ObjectX { ObjectXId = guid, Name = "Foo" };
connection.Insert(o1); connection.Insert(o1);
var objectXs = connection.GetAll<ObjectX>(); var objectXs = connection.GetAll<ObjectX>().ToList();
objectXs.Count().IsEqualTo(1); objectXs.Count.IsMoreThan(0);
objectXs.Count(x => x.ObjectXId== guid).IsEqualTo(1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment