Repository navigation
Expand file tree
/
Copy pathInMemoryDbCreationTest.cs
More file actions
64 lines (60 loc) · 1.98 KB
/
Copy pathInMemoryDbCreationTest.cs
File metadata and controls
64 lines (60 loc) · 1.98 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SQLite.CodeFirst.Console;
using SQLite.CodeFirst.Console.Entity;
namespace SQLite.CodeFirst.Test.IntegrationTests
{
[TestClass]
public class InMemoryDbCreationTest : InMemoryDbTest<FootballDbContext>
{
[TestMethod]
public void CreateInMemoryDatabaseTest()
{
using (var context = GetDbContext())
{
context.Set<Team>().Add(new Team
{
Name = "New",
Coach = new Coach
{
City = "New",
FirstName = "New",
LastName = "New",
Street = "New"
},
Players = new List<Player>
{
new Player
{
City = "New",
FirstName = "New",
LastName = "New",
Street = "New",
Number = 1
},
new Player
{
City = "New",
FirstName = "New",
LastName = "New",
Street = "New",
Number = 2
}
},
Stadion = new Stadion
{
Name = "New",
City = "New",
Street = "New"
}
});
context.SaveChanges();
}
using (var context = GetDbContext())
{
Assert.AreEqual(1, context.Set<Team>().Count());
}
}
}
}