diff options
author | crupest <crupest@outlook.com> | 2022-12-21 11:51:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-21 11:51:25 +0800 |
commit | 13a1aef3364c3ecfed41d30ceebdcd255ae8141c (patch) | |
tree | 411350f425f767fe6a8b3d1f753c713ea2b0a0e6 /docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs | |
parent | 4264d8135c066081dbabb412db17bf537ceab86e (diff) | |
download | crupest-13a1aef3364c3ecfed41d30ceebdcd255ae8141c.tar.gz crupest-13a1aef3364c3ecfed41d30ceebdcd255ae8141c.tar.bz2 crupest-13a1aef3364c3ecfed41d30ceebdcd255ae8141c.zip |
Develop secret api. v51
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, + }); + } + + +} |