Added web module tests
This commit is contained in:
12
tests/HopFrame.Tests.Web/Models/MyDbContext.cs
Normal file
12
tests/HopFrame.Tests.Web/Models/MyDbContext.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
14
tests/HopFrame.Tests.Web/Models/MyTable.cs
Normal file
14
tests/HopFrame.Tests.Web/Models/MyTable.cs
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user