Example #1
0
        public async Task TestBaseServiceDbUpdate_ShouldUpdate()
        {
            WikiPassageService service = new WikiPassageService();
            await service.AddAsync(BuildOneEntity());

            WikiPassage passage = service.GetById(1);

            passage.Content = "这是修改后的内容";

            await service.UpdateAsync(passage);

            Assert.True(service.GetById(1).Content == "这是修改后的内容");
        }
Example #2
0
        public async Task TestBaseServiceDbDelte_ShouldDeleteAsync()
        {
            WikiPassageService service = new WikiPassageService();
            await service.AddAsync(BuildOneEntity());

            WikiPassage passageToFind = service.GetById(1);

            await service.DeleteByIdAsync(1);

            WikiPassage passage = service.GetById(1);

            Assert.NotNull(passageToFind);
            Assert.Null(passage);
        }
Example #3
0
        public async Task TestBaseServiceDbWrite_ShouldCreateAsync()
        {
            var service = new WikiPassageService();

            await service.AddAsync(BuildOneEntity());

            WikiPassage passage = service.GetById(1);

            Assert.NotNull(passage);
        }