Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jSylvestre committed Oct 13, 2023
1 parent bf14676 commit 8dcbac3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Test/TestsController/ApiEquipmentControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void TestControllerClassAttributes()
[Fact]
public void TestControllerContainsExpectedNumberOfPublicMethods()
{
ControllerReflection.ControllerPublicMethods(17);
ControllerReflection.ControllerPublicMethods(18);
}

[Fact]
Expand Down Expand Up @@ -188,6 +188,17 @@ public void TestControllerMethodAttributes()
responseType.ElementAt(0).Type.GenericTypeArguments.ElementAt(0).Name.ShouldBe("Equipment");
responseType.ElementAt(0).StatusCode.ShouldBe(StatusCodes.Status200OK);

//17
ControllerReflection.MethodExpectedAttribute<HttpPostAttribute>("Duplicate", 4 + countAdjustment, "Duplicate", showListOfAttributes: false);
ControllerReflection.MethodExpectedAttribute<AsyncStateMachineAttribute>("Duplicate", 4 + countAdjustment, "Duplicate", showListOfAttributes: false);
responseType = ControllerReflection.MethodExpectedAttribute<ProducesResponseTypeAttribute>("Duplicate", 4 + countAdjustment, "Duplicate", showListOfAttributes: false);
responseType.ElementAt(0).Type.Name.ShouldBe("Equipment");
responseType.ElementAt(0).StatusCode.ShouldBe(StatusCodes.Status200OK);
response2 = ControllerReflection.MethodExpectedAttribute<ConsumesAttribute>("Duplicate", 4 + countAdjustment, "Duplicate", showListOfAttributes: false);
response2.Count().ShouldBe(1);
response2.ElementAt(0).ContentTypes.Count.ShouldBe(1);
response2.ElementAt(0).ContentTypes.ElementAt(0).ShouldBe(MediaTypeNames.Application.Json);

}

#endregion
Expand Down

0 comments on commit 8dcbac3

Please sign in to comment.