From b2378c666eaa7d3480f9bc555870dd0fe10f1d14 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 15 Nov 2020 14:04:08 +0100 Subject: [PATCH] Migration --- .../TestSuite.ApiTests/ContentUpdateTests.cs | 34 ++++--------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs index ac248402b..1b94a95a1 100644 --- a/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs +++ b/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs @@ -241,37 +241,15 @@ namespace TestSuite.ApiTests // STEP 2: Make an update with the upsert endpoint. - content = await _.Contents.UpsertAsync(id, new TestEntityData { Number = 2 }, true); + content = await _.Contents.UpsertAsync(id, new TestEntityData { Number = 2 }); - Assert.Equal(2, content.Version); - } - finally - { - if (content != null) - { - await _.Contents.DeleteAsync(content.Id); - } - } - } + Assert.Equal(2, content.Data.Number); - [Fact] - public async Task Should_upsert_item() - { - var id = Guid.NewGuid().ToString(); - - TestEntity content = null; - try - { - // STEP 1: Upsert a new item with a custom id. - content = await _.Contents.UpsertAsync(id, new TestEntityData { Number = 1 }, true); + // STEP 3: Make an update with the update endpoint. + content = await _.Contents.UpdateAsync(id, new TestEntityData { Number = 3 }); - // STEP 2: Upsert the item with a custom id and ensure that is has been updated. - await _.Contents.UpsertAsync(id, new TestEntityData { Number = 2 }); - - var updated = await _.Contents.GetAsync(content.Id); - - Assert.Equal(2, updated.Data.Number); + Assert.Equal(3, content.Data.Number); } finally { @@ -297,7 +275,7 @@ namespace TestSuite.ApiTests var updated = await _.Contents.GetAsync(content.Id); - Assert.Equal(2, updated.Data.Number); + Assert.Equal(2, content.Data.Number); } finally {