From 673aeab45542400efcbbe7f400c806af7b336df1 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 21 Dec 2022 16:32:38 +0800 Subject: Develop secret api. v54 --- .../CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (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 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); } -- cgit v1.2.3