ApprovalTests.Reporters.FirstWorkingReporter.IsWorkingInThisEnvironment C# (CSharp) Method

IsWorkingInThisEnvironment() public method

public IsWorkingInThisEnvironment ( string forFile ) : bool
forFile string
return bool
		public virtual bool IsWorkingInThisEnvironment(string forFile)
		{
			return reporters.Any(x => x.IsWorkingInThisEnvironment(forFile));
		}
	}

Usage Example

コード例 #1
0
        public void TestCallsFirstAndOnlyFirst()
        {
            var a = new RecordingReporter(false);
            var b = new RecordingReporter(true);
            var c = new RecordingReporter(true);

            var reporter = new FirstWorkingReporter(a,b,c);
            Assert.IsTrue(reporter.IsWorkingInThisEnvironment());
            reporter.Report("a","b");
            Assert.IsNull(a.CalledWith);
            Assert.AreEqual("a,b", b.CalledWith);
            Assert.IsNull(c.CalledWith);
        }