DD.WellWorkover.Cloud/AsbCloudWebApi.Tests/TestHelpter.cs
Харченко Владимир 87d7563ed3 CS2-27: Fixed ClusterService unit tests
2022-01-31 16:13:27 +05:00

24 lines
713 B
C#

using AsbCloudDb.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AsbCloudWebApi.Tests
{
internal static class TestHelpter
{
public static AsbCloudDbContext MakeTestContext()
{
var options = new DbContextOptionsBuilder<AsbCloudDbContext>()
.UseNpgsql("Host=localhost;Database=tests;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True")
.Options;
var context = new AsbCloudDbContext(options);
context.Database.Migrate();
return context;
}
}
}