Example #1
0
        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);
        }
Example #2
0
        public void Should_Have_RouteAttribute()
        {
            // Arrange
            var controller = new AuditLogController(_auditLogEntryServiceMock.Object);

            // Act
            var result = controller.GetType().GetCustomAttribute <RouteAttribute>();

            // Assert
            Assert.IsNotNull(result);
        }
Example #3
0
        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);
        }