public void Should_Have_RouteAttribute_With_Template_Of_AuditLog() { // Arrange var controller = new AuditLogController(_auditLogEntryServiceMock.Object); // Act var result = controller.GetType().GetCustomAttribute <RouteAttribute>()?.Template; // Assert Assert.AreEqual("api/auditlog", result); }
public void Should_Have_RouteAttribute() { // Arrange var controller = new AuditLogController(_auditLogEntryServiceMock.Object); // Act var result = controller.GetType().GetCustomAttribute <RouteAttribute>(); // Assert Assert.IsNotNull(result); }
public void GetAllAuditLogEntries_Should_Have_HttpGetAttribute() { // Arrange var controller = new AuditLogController(_auditLogEntryServiceMock.Object); // Act var result = controller.GetType().GetMethod(nameof(controller.GetAllAuditLogEntries)) ?.GetCustomAttribute <HttpGetAttribute>(); // Assert Assert.IsNotNull(result); }