mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-28 20:57:41 +08:00
Due to the way VS test works (by injecting an executable entry point), the performance tests needed to be factored out. I also organized all of our existing tests better along the way. Actual code changes to Dapper itself are very minor, only formatting and documentation fixes (which we need many more of). The build.ps1 script is upated to work, but note that <frameworkAssemblies> is not working in .nuspec inside the packages in the new .csproj system. I consider this to be a blocker. Issue is here: https://github.com/NuGet/Home/issues/4853
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
#if ENTITY_FRAMEWORK
|
|
using System.Data.Entity.Spatial;
|
|
using Xunit;
|
|
|
|
namespace Dapper.Tests.Providers
|
|
{
|
|
public class EntityFrameworkTests : TestBase
|
|
{
|
|
public EntityFrameworkTests()
|
|
{
|
|
EntityFramework.Handlers.Register();
|
|
}
|
|
|
|
[Fact]
|
|
public void Issue570_DbGeo_HasValues()
|
|
{
|
|
EntityFramework.Handlers.Register();
|
|
const string redmond = "POINT (122.1215 47.6740)";
|
|
DbGeography point = DbGeography.PointFromText(redmond, DbGeography.DefaultCoordinateSystemId);
|
|
DbGeography orig = point.Buffer(20);
|
|
|
|
var fromDb = connection.QuerySingle<DbGeography>("declare @geos table(geo geography); insert @geos(geo) values(@val); select * from @geos",
|
|
new { val = orig });
|
|
|
|
fromDb.Area.IsNotNull();
|
|
fromDb.Area.IsEqualTo(orig.Area);
|
|
}
|
|
|
|
[Fact]
|
|
public void Issue22_ExecuteScalar_EntityFramework()
|
|
{
|
|
var geo = DbGeography.LineFromText("LINESTRING(-122.360 47.656, -122.343 47.656 )", 4326);
|
|
var geo2 = connection.ExecuteScalar<DbGeography>("select @geo", new { geo });
|
|
geo2.IsNotNull();
|
|
}
|
|
}
|
|
}
|
|
#endif
|