From d37936cdea3e257388506dd055194a0b752263a3 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 21 Dec 2022 11:51:25 +0800 Subject: Develop secret api. v51 --- .../Crud/CrudServiceTest.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs') diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs new file mode 100644 index 0000000..0c42c67 --- /dev/null +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.Logging.Abstractions; + +namespace CrupestApi.Commons.Crud.Tests; + +public class CrudServiceTest +{ + private readonly SqliteMemoryConnectionFactory _memoryConnectionFactory = new SqliteMemoryConnectionFactory(); + + private readonly CrudService _crudService; + + public CrudServiceTest() + { + var columnTypeProvider = new ColumnTypeProvider(); + var tableInfoFactory = new TableInfoFactory(columnTypeProvider, NullLoggerFactory.Instance); + var dbConnectionFactory = new SqliteMemoryConnectionFactory(); + + _crudService = new CrudService( + tableInfoFactory, dbConnectionFactory, NullLoggerFactory.Instance); + } + + [Fact] + public void CrudTest() + { + _crudService.Create(new TestEntity() + { + Name = "crupest", + Age = 18, + }); + } + + +} -- cgit v1.2.3