Skip to content

Commit

Permalink
Update assert methods of instrumentation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehats committed Dec 18, 2023
1 parent ea1a521 commit feac004
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/Controllers/InstrumentationControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ public async Task GetByIdAsync()
var instrumentationId = context.Instrumentations.First().Id;

var response = await controller.GetByIdAsync(instrumentationId).ConfigureAwait(false);
ActionResultAssert.IsOk(response.Result);

var instrumentation = response.Value;
Assert.IsNotNull(instrumentation);
var instrumentation = ActionResultAssert.IsOkObjectResult<Instrumentation>(response.Result);
Assert.AreEqual(instrumentationId, instrumentation.Id);
}

Expand All @@ -79,8 +76,7 @@ public async Task CreateAsync()
};

var response = await controller.CreateAsync(instrumentation);
ActionResultAssert.IsOk(response.Result);
Assert.IsNotNull(response.Value);
ActionResultAssert.IsOkObjectResult<Instrumentation>(response.Result);

instrumentation = await context.Instrumentations.FindAsync(instrumentation.Id);
Assert.IsNotNull(instrumentation);
Expand All @@ -107,8 +103,7 @@ public async Task EditAsync()
instrumentation.ToDepth = 200;

var response = await controller.EditAsync(instrumentation);
ActionResultAssert.IsOk(response.Result);
Assert.IsNotNull(response.Value);
ActionResultAssert.IsOkObjectResult<Instrumentation>(response.Result);

instrumentation = await context.Instrumentations.FindAsync(instrumentation.Id);
Assert.IsNotNull(instrumentation);
Expand Down

0 comments on commit feac004

Please sign in to comment.