コード例 #1
0
        public ApplicationController(CompositionContainer _container,
                                     ShellViewModel shellViewModel
                                     , InvoiceController _invoiceController
                                     , ClientDefController _clientDefController
//#if ONE_AT_A_TIME
                                     , ContractController _contractController
                                     , ReportsController _reportsController
                                     , AdministrationController _administrationController
//#endif
                                     , ErrorManController _errorManController
                                     , BatchJobController _batchJobController
                                     , AuditLogController _auditLogController
                                     )
        {
            if (shellViewModel == null)
            {
                throw new ArgumentNullException("shellViewModel");
            }
            container = _container;
            //loginController = _loginController;
            this.shellViewModel    = shellViewModel;
            this.invoiceController = _invoiceController;
            clientDefController    = _clientDefController;

//#if ONE_AT_A_TIME
            this.contractController  = _contractController;
            reportsController        = _reportsController;
            administrationController = _administrationController;
//#endif
            errorManController = _errorManController;
            batchJobController = _batchJobController;
            auditLogController = _auditLogController;
        }
コード例 #2
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);
        }
コード例 #3
0
        public void Should_Have_RouteAttribute()
        {
            // Arrange
            var controller = new AuditLogController(_auditLogEntryServiceMock.Object);

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

            // Assert
            Assert.IsNotNull(result);
        }
コード例 #4
0
        public void GetAllAuditLogEntries_Should_Call_GetAllAuditLogEntries_On_AuditLogEntryService()
        {
            // Arrange
            var controller = new AuditLogController(_auditLogEntryServiceMock.Object);

            // Act
            var result = controller.GetAllAuditLogEntries();

            // Assert
            _auditLogEntryServiceMock.Verify(service => service.GetAllAuditLogEntries());
        }
コード例 #5
0
        public void GetAllAuditLogEntries_Should_Return_Instance_Of_Type_IEnumerable_With_AuditLogEntryViewModel()
        {
            // Arrange
            var controller = new AuditLogController(_auditLogEntryServiceMock.Object);

            // Act
            var result = controller.GetAllAuditLogEntries();

            // Assert
            Assert.IsInstanceOfType(result, typeof(IEnumerable <AuditLogEntryViewModel>));
        }
コード例 #6
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);
        }