コード例 #1
0
        public void TestNotAllowsToAnalyzeInhritentFrom()
        {
            //Given
            AnalyzerImpl analyzer = new AnalyzerImpl();
            analyzer.LastResponse = new Object();
            MockStringAnalyzerParameter parameter = new MockStringAnalyzerParameter();

            //When
            analyzer.Analyze(parameter);

            //Then
            Assert.AreEqual(false, parameter.Status);
        }
コード例 #2
0
        public void TestAllowsToAnalyzeInhritentFrom()
        {
            //Given
            AnalyzerImpl analyzer = new AnalyzerImpl();
            analyzer.LastResponse = new String(new char[] {});
            MockObjectAnalyzerParameter parameter = new MockObjectAnalyzerParameter();

            //When
            analyzer.Analyze(parameter);

            //Then
            Assert.AreEqual(true, parameter.Status);
        }
コード例 #3
0
        public void TestSuccessfulSimpleAnalyzing()
        {
            //Given
            AnalyzerImpl analyzer = new AnalyzerImpl();
            analyzer.LastResponse = "This is some test text";
            FindText parameter = new FindText("some");

            //When
            analyzer.Analyze(parameter);

            //Then
            Assert.AreEqual(true,parameter.Status);
            Assert.AreEqual(FindText.SuccessMessage, parameter.Title);
        }
コード例 #4
0
        public void TestFailureInSimpleAnalyzing()
        {
            //Given
            AnalyzerImpl analyzer = new AnalyzerImpl();
            analyzer.LastResponse = "This is some test text";
            FindText parameter = new FindText("other text");

            //When
            analyzer.Analyze(parameter);

            //Then
            Assert.AreEqual(false, parameter.Status);
            Assert.AreEqual(FindText.FailureMessage, parameter.Title);
        }