diff --git a/Tests/Controllers/CatsControllerTest.cs b/Tests/Controllers/CatsControllerTest.cs index 796fca7..eca1e84 100644 --- a/Tests/Controllers/CatsControllerTest.cs +++ b/Tests/Controllers/CatsControllerTest.cs @@ -31,20 +31,20 @@ namespace cat_cafe.Controllers.Tests private readonly MapperConfiguration mapperConf = new(mapper => mapper.AddProfile(typeof(CatMapper))); - private readonly DbContextOptions options = new DbContextOptionsBuilder() - .UseInMemoryDatabase(databaseName: "CatCafeTests") + private readonly DbContextOptions options = new DbContextOptionsBuilder() + .UseSqlite("Data Source=EFCatCafe.db").EnableSensitiveDataLogging() .Options; private readonly IMapper mapper; - private readonly CatCafeContext context; + private readonly CatCafeDbContext context; private readonly CatsController controller; public CatsControllerTest() { mapper = mapperConf.CreateMapper(); - context = new CatCafeContext(options); + context = new CatCafeDbContext(options); controller = new CatsController(context, mapper, logger); } @@ -53,7 +53,7 @@ namespace cat_cafe.Controllers.Tests public void BeforeEach() { context.Database.EnsureCreated(); - context.Cats.AddRange( + context.cats.AddRange( new Cat { Id = 1, diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 92027b6..3ece581 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -15,10 +15,14 @@ + + + + diff --git a/cat_cafe/log.txt b/cat_cafe/log.txt index 2fc4e6c..417a5a1 100644 --- a/cat_cafe/log.txt +++ b/cat_cafe/log.txt @@ -149,3 +149,4 @@ 2023-02-04 11:48:05.671 +01:00 [INF] program start 2023-02-04 11:48:15.442 +01:00 [INF] GET => get All customers 2023-02-04 11:48:15.516 +01:00 [INF] GET => 200 System.Collections.Generic.List`1[cat_cafe.Entities.Customer] length[5] +2023-02-04 12:00:49.695 +01:00 [INF] program start