-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuartzTriggerModelMappingTests.cs
More file actions
35 lines (28 loc) · 1.13 KB
/
Copy pathQuartzTriggerModelMappingTests.cs
File metadata and controls
35 lines (28 loc) · 1.13 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
namespace AppAny.Quartz.EntityFrameworkCore.Migrations.SQLite.Tests;
using AppAny.Quartz.EntityFrameworkCore.Migrations;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
public class QuartzTriggerModelMappingTests
{
[Fact]
public void ShouldMapMisfireOriginalFireTimeColumn()
{
var connectionString = new SqliteConnectionStringBuilder
{
Mode = SqliteOpenMode.Memory,
DataSource = ":memory:"
}.ToString();
var options = new DbContextOptionsBuilder<SQLiteIntegrationDbContext>()
.UseSqlite(connectionString)
.Options;
using var dbContext = new SQLiteIntegrationDbContext(options);
var entityType = dbContext.Model.FindEntityType(typeof(QuartzTrigger));
Assert.NotNull(entityType);
var property = entityType!.FindProperty(nameof(QuartzTrigger.MisfireOriginalFireTime));
Assert.NotNull(property);
var table = StoreObjectIdentifier.Table(entityType.GetTableName()!, entityType.GetSchema());
Assert.Equal("MISFIRE_ORIG_FIRE_TIME", property!.GetColumnName(table));
Assert.Equal("bigint", property.GetColumnType());
}
}