Added unit tests for API and Web App

Also updated backend to use .NET6
This commit is contained in:
2023-03-06 21:59:17 -06:00
parent efb22aa0af
commit 771b63f6c4
14 changed files with 971 additions and 262 deletions

View File

@ -12,6 +12,7 @@ namespace YABA.Data.Context
{
public class YABABaseContext : DbContext
{
public YABABaseContext() : base() { }
public YABABaseContext(DbContextOptions<YABABaseContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
@ -47,10 +48,10 @@ namespace YABA.Data.Context
.IsUnique();
}
public DbSet<Bookmark> Bookmarks { get; set; }
public DbSet<Tag> Tags { get; set; }
public DbSet<BookmarkTag> BookmarkTags { get; set; }
public DbSet<User> Users { get; set; }
public virtual DbSet<Bookmark> Bookmarks { get; set; }
public virtual DbSet<Tag> Tags { get; set; }
public virtual DbSet<BookmarkTag> BookmarkTags { get; set; }
public virtual DbSet<User> Users { get; set; }
private static LambdaExpression ConvertFilterExpression<TInterface>(
Expression<Func<TInterface, bool>> filterExpression,

View File

@ -4,6 +4,7 @@ namespace YABA.Data.Context
{
public class YABAReadOnlyContext : YABABaseContext
{
public YABAReadOnlyContext() : base() { }
public YABAReadOnlyContext(DbContextOptions<YABABaseContext> options) : base(options)
{
ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;

View File

@ -9,6 +9,8 @@ namespace YABA.Data.Context
{
public class YABAReadWriteContext : YABABaseContext
{
public YABAReadWriteContext() : base() { }
public YABAReadWriteContext(DbContextOptions<YABABaseContext> options) : base(options)
{
ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;