Added web module tests

This commit is contained in:
2025-01-19 16:00:33 +01:00
parent 8d63910aae
commit 80aa650a2c
26 changed files with 587 additions and 71 deletions

View File

@@ -0,0 +1,12 @@
using Microsoft.EntityFrameworkCore;
namespace HopFrame.Tests.Web.Models;
public class MyDbContext : DbContext {
public DbSet<MyTable> Table1 { get; set; }
public DbSet<MyTable2> Table2 { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
optionsBuilder.UseInMemoryDatabase(nameof(MyDbContext));
}
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HopFrame.Tests.Web.Models;
public class MyTable {
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
}
public class MyTable2 {
[Key]
public string Id { get; set; }
}