Added more tests

This commit is contained in:
2025-01-19 12:12:01 +01:00
parent afe8a41f6c
commit 8d63910aae
14 changed files with 529 additions and 60 deletions

View File

@@ -18,6 +18,24 @@ public class HopFrameConfiguratorTests {
Assert.IsType<DbContextConfig>(config.Contexts[0]);
Assert.IsType<DbContextConfigurator<MockDbContext>>(dbContextConfigurator);
}
[Fact]
public void AddDbContext_WithConfigurator_AddsDbContextToInnerConfig() {
// Arrange
var config = new HopFrameConfig();
var configurator = new HopFrameConfigurator(config);
// Act
object dbContextConfigurator = null!;
configurator.AddDbContext<MockDbContext>(context => {
dbContextConfigurator = context;
});
// Assert
Assert.Single(config.Contexts);
Assert.IsType<DbContextConfig>(config.Contexts[0]);
Assert.IsType<DbContextConfigurator<MockDbContext>>(dbContextConfigurator);
}
[Fact]
public void DisplayUserInfo_SetsDisplayUserInfoProperty() {