Пример #1
0
        public void IsValidFileName_ExtManagerThrowsException_ReturnsFalse()
        {
            FakeExtensionManager myFakeManager = new FakeExtensionManager();

            myFakeManager.WillThrow = new Exception("this is fake");
            LogAnalyzer log =
                new LogAnalyzer(myFakeManager);
            bool result = log.IsValidLogFileName("anything.anyextension");

            Assert.False(result);
        }
Пример #2
0
        public void IsValidFileName_NameSupportedExtension_ReturnsTrue()
        {
            FakeExtensionManager stub = new FakeExtensionManager();

            stub.WillBeValid = true;
            LogAnalyzer log =
                new LogAnalyzer(stub);
            bool result = log.IsValidLogFileName("short.ext");

            Assert.True(result);
        }