Inheritance: IExtensionManager
コード例 #1
0
        public void IsValidFileName_NameShorterThan6CharsButSupportedExtension_ReturnsFalse()
        {
            //setup the stub to use, make sure it returns true
            StubExtensionManager myFakeManager = new StubExtensionManager();
            myFakeManager.ShouldBeValid = true;

            //create analyzer and inject stub
            LogAnalyzerConstructorStub log =
                new LogAnalyzerConstructorStub(myFakeManager);

            //Assert logic assuming extension is supprted
            bool result = log.IsValidLogFileName("short.ext");
            Assert.IsFalse(result,"File name with less than 5 chars should have failed the method, even if the extension is supported");
        }
コード例 #2
0
        public void IsValidFileName_NameShorterThan6CharsButSupportedExtension_ReturnsFalse()
        {
            //setup the stub to use, make sure it returns true
            StubExtensionManager myFakeManager = new StubExtensionManager();

            myFakeManager.ShouldBeValid = true;

            //create analyzer and inject stub
            LogAnalyzerConstructorStub log =
                new LogAnalyzerConstructorStub(myFakeManager);

            //Assert logic assuming extension is supprted
            bool result = log.IsValidLogFileName("short.ext");

            Assert.IsFalse(result, "File name with less than 5 chars should have failed the method, even if the extension is supported");
        }