-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreTests.cs
More file actions
44 lines (35 loc) · 954 Bytes
/
CoreTests.cs
File metadata and controls
44 lines (35 loc) · 954 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[TestFixture]
[Parallelizable(ParallelScope.All)]
public class CoreTests
{
// ReSharper disable once UnusedVariable
static void Build(string connection)
{
#region EnableRecording
var builder = new DbContextOptionsBuilder<SampleDbContext>();
builder.UseSqlServer(connection);
builder.EnableRecording();
var data = new SampleDbContext(builder.Options);
#endregion
}
[Test]
public async Task RecordingTest()
{
var database = await DbContextBuilder.GetDatabase();
var data = database.Context;
#region Recording
var company = new Company
{
Name = "Title"
};
data.Add(company);
await data.SaveChangesAsync();
Recording.Start();
await data
.Companies
.Where(_ => _.Name == "Title")
.ToListAsync();
await Verify();
#endregion
}
}