aboutsummaryrefslogtreecommitdiff
path: root/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-12-22 17:47:07 +0800
committercrupest <crupest@outlook.com>2022-12-22 17:47:07 +0800
commit3469ac050b13b73d76f13dcbdfa77a1aefc49ae0 (patch)
tree0fb74f6fb4e8603f9625a72ea82a06dbf72436e6 /docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs
parentb022122b0a697f063433d5fe525e536bd23e8372 (diff)
downloadcrupest-3469ac050b13b73d76f13dcbdfa77a1aefc49ae0.tar.gz
crupest-3469ac050b13b73d76f13dcbdfa77a1aefc49ae0.tar.bz2
crupest-3469ac050b13b73d76f13dcbdfa77a1aefc49ae0.zip
Develop secret api. v58
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.cs10
1 files changed, 9 insertions, 1 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 a515d2f..284dbe2 100644
--- a/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs
+++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons.Tests/Crud/CrudServiceTest.cs
@@ -64,5 +64,13 @@ public class CrudServiceTest
Assert.Equal(0, count);
}
-
+ [Fact]
+ public void EntityNotExistTest()
+ {
+ Assert.Throws<EntityNotExistException>(() => _crudService.GetByKey("KeyNotExist"));
+ Assert.Throws<EntityNotExistException>(() => _crudService.UpdateByKey("KeyNotExist", new TestEntity
+ {
+ Name = "crupest"
+ }));
+ }
}