Skip to content

Commit 01cd70a

Browse files
committed
Moved InMemoryAdapter to Core; implemented Joins
1 parent 6412991 commit 01cd70a

9 files changed

Lines changed: 300 additions & 273 deletions

File tree

Simple.Data.InMemory/InMemoryAdapter.cs

Lines changed: 0 additions & 117 deletions
This file was deleted.

Simple.Data.InMemory/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

Simple.Data.InMemory/Simple.Data.InMemory.csproj

Lines changed: 0 additions & 60 deletions
This file was deleted.

Simple.Data.InMemoryTest/InMemoryTests.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading;
6-
7-
namespace Simple.Data.InMemoryTest
1+
namespace Simple.Data.InMemoryTest
82
{
9-
using InMemory;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Threading;
106
using NUnit.Framework;
117

128
[TestFixture]
@@ -216,11 +212,28 @@ public void TestSkipAndTake()
216212
Assert.AreEqual(8, records[0].Id);
217213
}
218214

215+
[Test]
216+
public void TestJoin()
217+
{
218+
var adapter = new InMemoryAdapter();
219+
adapter.ConfigureJoin("Customer", "ID", "Orders", "Order", "CustomerID", "Customer");
220+
Database.UseMockAdapter(adapter);
221+
var db = Database.Open();
222+
db.Customer.Insert(ID: 1, Name: "NASA");
223+
db.Customer.Insert(ID: 2, Name: "ACME");
224+
db.Order.Insert(ID: 1, CustomerID: 1, Date: new DateTime(1997, 1, 12));
225+
db.Order.Insert(ID: 2, CustomerID: 2, Date: new DateTime(2001, 1, 1));
226+
227+
var customers = db.Customer.FindAll(db.Customer.Orders.Date < new DateTime(1999, 12, 31)).ToList();
228+
Assert.IsNotNull(customers);
229+
Assert.AreEqual(1, customers.Count);
230+
}
231+
219232
/// <summary>
220233
///A test for Find
221234
///</summary>
222235
[Test]
223-
public void SeparateThreads_Should_SeeDifferentMocks()
236+
public void SeparateThreadsShouldSeeDifferentMocks()
224237
{
225238
int r1 = 0;
226239
int r2 = 0;

Simple.Data.InMemoryTest/Simple.Data.InMemoryTest.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
<None Include="packages.config" />
5757
</ItemGroup>
5858
<ItemGroup>
59-
<ProjectReference Include="..\Simple.Data.InMemory\Simple.Data.InMemory.csproj">
60-
<Project>{976ED1B4-04B7-489F-93B6-F99F587D49CB}</Project>
61-
<Name>Simple.Data.InMemory</Name>
62-
</ProjectReference>
6359
<ProjectReference Include="..\Simple.Data\Simple.Data.csproj">
6460
<Project>{148CEE80-2E84-4ABD-B5AB-20415B2BBD21}</Project>
6561
<Name>Simple.Data</Name>

Simple.Data.sln

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Profiling", "Profiling", "{
5353
EndProject
5454
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProfilingApp", "ProfilingApp\ProfilingApp.csproj", "{9AAF3008-8033-4A26-93D2-97928E7801E9}"
5555
EndProject
56-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simple.Data.InMemory", "Simple.Data.InMemory\Simple.Data.InMemory.csproj", "{976ED1B4-04B7-489F-93B6-F99F587D49CB}"
57-
EndProject
5856
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simple.Data.InMemoryTest", "Simple.Data.InMemoryTest\Simple.Data.InMemoryTest.csproj", "{1B6A87C0-4ACA-4411-8879-844537A52126}"
5957
EndProject
6058
Global
@@ -217,16 +215,6 @@ Global
217215
{9AAF3008-8033-4A26-93D2-97928E7801E9}.Release|Mixed Platforms.Build.0 = Release|x86
218216
{9AAF3008-8033-4A26-93D2-97928E7801E9}.Release|x86.ActiveCfg = Release|x86
219217
{9AAF3008-8033-4A26-93D2-97928E7801E9}.Release|x86.Build.0 = Release|x86
220-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
221-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
222-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
223-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
224-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Debug|x86.ActiveCfg = Debug|Any CPU
225-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
226-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Release|Any CPU.Build.0 = Release|Any CPU
227-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
228-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
229-
{976ED1B4-04B7-489F-93B6-F99F587D49CB}.Release|x86.ActiveCfg = Release|Any CPU
230218
{1B6A87C0-4ACA-4411-8879-844537A52126}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
231219
{1B6A87C0-4ACA-4411-8879-844537A52126}.Debug|Any CPU.Build.0 = Debug|Any CPU
232220
{1B6A87C0-4ACA-4411-8879-844537A52126}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU

0 commit comments

Comments
 (0)