diff options
author | crupest <crupest@outlook.com> | 2022-12-21 16:32:38 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-12-21 16:32:38 +0800 |
commit | 673aeab45542400efcbbe7f400c806af7b336df1 (patch) | |
tree | 7a707dea3daa2c860a0bb215fef44bbcf76f4efc /docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests | |
parent | dbeec571d95c42de6c86e04239256d9a0f698a91 (diff) | |
download | crupest-673aeab45542400efcbbe7f400c806af7b336df1.tar.gz crupest-673aeab45542400efcbbe7f400c806af7b336df1.tar.bz2 crupest-673aeab45542400efcbbe7f400c806af7b336df1.zip |
Develop secret api. v54
Diffstat (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests')
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs | 17 | ||||
-rw-r--r-- | docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/TableInfoTest.cs | 6 |
2 files changed, 19 insertions, 4 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 index 0c42c67..b7b7ccd 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs @@ -21,11 +21,26 @@ public class CrudServiceTest [Fact] public void CrudTest() { - _crudService.Create(new TestEntity() + var key = _crudService.Create(new TestEntity() { Name = "crupest", Age = 18, }); + + Assert.Equal("crupest", key); + + var entity = _crudService.GetByKey(key); + Assert.Equal("crupest", entity.Name); + Assert.Equal(18, entity.Age); + Assert.Null(entity.Height); + Assert.NotEmpty(entity.Secret); + + var list = _crudService.GetAll(); + entity = Assert.Single(list); + Assert.Equal("crupest", entity.Name); + Assert.Equal(18, entity.Age); + Assert.Null(entity.Height); + Assert.NotEmpty(entity.Secret); } diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/TableInfoTest.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/TableInfoTest.cs index 228f442..b0aa702 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/TableInfoTest.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/TableInfoTest.cs @@ -16,9 +16,9 @@ public class TableInfoTest [Fact] public void TestColumnCount() { - Assert.Equal(4, _tableInfo.Columns.Count); - Assert.Equal(3, _tableInfo.PropertyColumns.Count); - Assert.Equal(3, _tableInfo.ColumnProperties.Count); + Assert.Equal(5, _tableInfo.Columns.Count); + Assert.Equal(4, _tableInfo.PropertyColumns.Count); + Assert.Equal(4, _tableInfo.ColumnProperties.Count); Assert.Equal(1, _tableInfo.NonColumnProperties.Count); } |