Exemple #1
0
        IsValidFileName_WhenCalled_ChangesWasLastFileNameValid()
        {
            LogAnalyzer la = new LogAnalyzer();

            la.IsValidLogFileNameee("badname.slf");
            Assert.True(la.WasLastFileNameValid);
        }
Exemple #2
0
        public void IsValidFileName_EmptyFileName_Throws() //s62
        {
            LogAnalyzer la = new LogAnalyzer();
            var         ex = Assert.Throws <ArgumentException>(() => la.IsValidLogFileNameee(""));

            StringAssert.Contains("nale¿y podaæ nazwê pliku", ex.Message);
        }
Exemple #3
0
        public void IsValidLogFileName_GoodExtensionUppercase_ReturnsTrue(string file, bool expected)
        {
            LogAnalyzer analyzer = new LogAnalyzer();
            bool        result   = analyzer.IsValidLogFileNameee(file);

            Assert.AreEqual(expected, result);
        }
Exemple #4
0
        public void IsValidLogFileName_GoodExtensionUppercase_ReturnsTrue(string file)
        {
            LogAnalyzer analyzer = new LogAnalyzer();
            bool        result   = analyzer.IsValidLogFileNameee(file);

            Assert.True(result);
        }
Exemple #5
0
        public void IsValidLogFileName_BadExtension_ReturnsFalse()
        {
            LogAnalyzer analyzer = new LogAnalyzer();
            bool        result   = analyzer.IsValidLogFileNameee("test.txt");

            Assert.False(result);
        }
Exemple #6
0
        IsValidFileName_WhenCalled_ChangesWasLastFileNameValid(string file,
                                                               bool expected)
        {
            LogAnalyzer la = MakeAnalyzer();

            la.IsValidLogFileNameee(file);
            Assert.AreEqual(expected, la.WasLastFileNameValid);
        }
Exemple #7
0
        [Category("Szybkie testy")] //s65
        public void IsValidLogFileName_GoodExtensionLowercase_ReturnsTrue()
        {
            LogAnalyzer analyzer = new LogAnalyzer();
            bool        result   = analyzer
                                   .IsValidLogFileNameee("filewithgoodextension.slf");

            Assert.True(result);
        }
        public void IsValidFileName_NameSupportedExtension_ReturnsTrue()
        {
            FakeExtensionManager myFakeManager = new FakeExtensionManager(); //Przes³anie namiastki

            myFakeManager.WillBeValid = true;                                //konfiguracja namiastki która zwraca true
            LogAnalyzer log    = new LogAnalyzer(myFakeManager);
            bool        result = log.IsValidLogFileNameee("short.ext");

            Assert.True(result);
        }
        public void IsValidFileName_ExtManagerThrowsException_ReturnsFalse()
        {
            FakeExtensionManager myFakeManager = new FakeExtensionManager();

            myFakeManager.WillThrow = new Exception("to jest sztuczny wyj¹tek");
            LogAnalyzer log    = new LogAnalyzer(myFakeManager);
            bool        result = log.IsValidLogFileNameee("anything.anyextension");

            Assert.False(result);
        }