-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuartzTriggerModelMappingTests.cs
More file actions
30 lines (24 loc) · 1.08 KB
/
Copy pathQuartzTriggerModelMappingTests.cs
File metadata and controls
30 lines (24 loc) · 1.08 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
namespace AppAny.Quartz.EntityFrameworkCore.Migrations.MySql.Tests;
using AppAny.Quartz.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
public class QuartzTriggerModelMappingTests
{
[Fact]
public void ShouldMapMisfireOriginalFireTimeColumn()
{
var options = new DbContextOptionsBuilder<MySqlIntegrationDbContext>()
.UseMySql(
"Server=localhost;Port=3306;Database=quartz_mapping_tests;User=root;Password=password",
ServerVersion.Parse("8.0.36-mysql"))
.Options;
using var dbContext = new MySqlIntegrationDbContext(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(19)", property.GetColumnType());
}
}