forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderDetailTests.cs
More file actions
29 lines (27 loc) · 891 Bytes
/
OrderDetailTests.cs
File metadata and controls
29 lines (27 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using NUnit.Framework;
namespace Simple.Data.SqlCeTest
{
[TestFixture]
public class OrderDetailTests
{
private static readonly string DatabasePath = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase.Substring(8)),
"TestDatabase.sdf");
[Test]
public void TestOrderDetail()
{
var db = Database.OpenFile(DatabasePath);
var order = db.Orders.FindByOrderDate(new DateTime(2010, 8, 11));
IEnumerable<dynamic> orderItems = order.OrderItems;
var orderItem = orderItems.FirstOrDefault();
var item = orderItem.Item;
Assert.AreEqual("Widget", item.Name);
}
}
}