示例#1
0
        //Code adapted from Art of Unit Testing
        public ActionResult LogAnalyzer()
        {
            LoanLogic loanLogic = new LoanLogic(repo);

            string fileName = string.Format("{0}", "hmm.foo");

            //bool original = loanLogic.IsValidLogFileName(fileName);
            bool refactored = loanLogic.IsValidLogFileNameREFACTORED(fileName);


            return(View());
        }
        public void LogAnalyzer_ValidFileName_Pass()
        {
            // Arrange
            IFileExtensionManager manager   = new AlwaysValidFakeExtensionManager();
            LoanLogic             loanLogic = new LoanLogic(manager);

            string foo    = "kung.foo";
            bool   result = false;

            // Act
            result = loanLogic.IsValidLogFileNameREFACTORED(foo);

            // Assert
            Assert.IsTrue(result);
        }