diff options
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs | 32 |
1 files changed, 32 insertions, 0 deletions
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<TestEntity> _crudService; + + public CrudServiceTest() + { + var columnTypeProvider = new ColumnTypeProvider(); + var tableInfoFactory = new TableInfoFactory(columnTypeProvider, NullLoggerFactory.Instance); + var dbConnectionFactory = new SqliteMemoryConnectionFactory(); + + _crudService = new CrudService<TestEntity>( + tableInfoFactory, dbConnectionFactory, NullLoggerFactory.Instance); + } + + [Fact] + public void CrudTest() + { + _crudService.Create(new TestEntity() + { + Name = "crupest", + Age = 18, + }); + } + + +} |