fix
This commit is contained in:
@@ -58,10 +58,7 @@ public class MigrationsTests : IDisposable
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void InitialCreateMigration_ShouldHaveCorrectConstants()
|
public void InitialCreateMigration_ShouldHaveCorrectConstants()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange & Act & Assert
|
||||||
var migration = new InitialCreate();
|
|
||||||
|
|
||||||
// Act & Assert
|
|
||||||
// Use reflection to access private constants
|
// Use reflection to access private constants
|
||||||
var migrationType = typeof(InitialCreate);
|
var migrationType = typeof(InitialCreate);
|
||||||
|
|
||||||
@@ -160,10 +157,11 @@ public class MigrationsTests : IDisposable
|
|||||||
var foreignKeys = chatMessageEntity.GetForeignKeys();
|
var foreignKeys = chatMessageEntity.GetForeignKeys();
|
||||||
foreignKeys.Should().HaveCount(1);
|
foreignKeys.Should().HaveCount(1);
|
||||||
|
|
||||||
var foreignKey = foreignKeys[0];
|
var foreignKey = foreignKeys.First();
|
||||||
foreignKey.PrincipalEntityType.Should().Be(chatSessionEntity);
|
foreignKey.PrincipalEntityType.Should().Be(chatSessionEntity);
|
||||||
foreignKey.Properties.Should().HaveCount(1);
|
var properties = foreignKey.Properties;
|
||||||
foreignKey.Properties[0].Name.Should().Be("SessionId");
|
properties.Should().HaveCount(1);
|
||||||
|
properties.First().Name.Should().Be("SessionId");
|
||||||
foreignKey.DeleteBehavior.Should().Be(DeleteBehavior.Cascade);
|
foreignKey.DeleteBehavior.Should().Be(DeleteBehavior.Cascade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user