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); }
public void IsValidFileName_NameSupportedExtension_ReturnsTrue() { FakeExtensionManager myFakeManager = new FakeExtensionManager(); myFakeManager.WillBeValid = true; LogAnalyzer log = new LogAnalyzer(myFakeManager); bool result = log.IsValidLogFileName("short.ext"); Assert.True(result); }