Exemplo n.º 1
0
        public void IsValidLogFileNameShouldThrowExceptionWhenFilenameIsNullOrEmpty(string filename)
        {
            const string ExpectedResult = "No filename provided";
            var          stub           = new FakeExtensionManager {
                WillThrow = new ArgumentException("No filename provided")
            };
            var analyzer = new FakeLogAnalyzerExtensionManager(stub);
            var result   = Assert.Throws <ArgumentException>(() => analyzer.IsValidLogFileName(filename));

            Assert.That(result.Message, Does.Contain(ExpectedResult));
        }
Exemplo n.º 2
0
        public void IsValidLogFileNameShouldReturnFalseWhenExtensionManagerRejectsExtension()
        {
            const bool ExpectedResult = false;
            var        stub           = new FakeExtensionManager {
                WillBeValid = false
            };
            var analyzer = new FakeLogAnalyzerExtensionManager(stub);
            var result   = analyzer.IsValidLogFileName("file.ext");

            Assert.That(result, Is.EqualTo(ExpectedResult));
        }