コード例 #1
0
        public void ErrorLog_Addlog_InvalidModelState()
        {
            // Arrange
            var service = new ErrorLogsController(_errorLogRepository);

            service.ModelState.AddModelError("key", "error message");
            // Act
            var result = service.AddLog(_data) as OkNegotiatedContentResult <LogDetails>;
        }
コード例 #2
0
        public void ErrorLog_Addlog_Invalid()
        {
            // Arrange
            var service = new ErrorLogsController(_errorLogRepository);

            ((ErrorLogRepositoryMock)_errorLogRepository).AddShouldFail = true;

            // Act
            var result = service.AddLog(_data) as OkNegotiatedContentResult <LogDetails>;
        }
コード例 #3
0
        public void ErrorLog_AddLogs()
        {
            // Arrange
            var service = new ErrorLogsController(_errorLogRepository);

            // Act
            var result = service.AddLog(_data) as OkNegotiatedContentResult <LogDetails>;;

            // Assert
            Assert.AreEqual(_data.EIN, result.Content.EIN);
        }