Exemplo n.º 1
0
		public void LogEventsFromTextOutput (string lineText, LogEvent expected)
		{
			var task = new LogEventsFromTextOutputToolTask ();
			task.LogEventsFromTextOutput (lineText);
			Assert.AreEqual (task.LogEvents.Count, 1);
			var result = task.LogEvents[0];
			task.LogEvents.Clear ();

			if (result != null && result.Origin == task.GetType ().Name.ToUpper ())
				result.Origin = "#TASKNAME";

			if (expected == null) {
				Assert.IsNull (result, "#nomatch");
				return;
			}

			Assert.IsNotNull (result, "#match");
			Assert.AreEqual (expected.Origin, result.Origin, "#origin");
			Assert.AreEqual (expected.Line, result.Line, "#line");
			Assert.AreEqual (expected.Column, result.Column, "#column");
			Assert.AreEqual (expected.EndLine, result.EndLine, "#endline");
			Assert.AreEqual (expected.EndColumn, result.EndColumn, "#endcolumn");
			Assert.AreEqual (expected.IsError, result.IsError, "#iserror");
			Assert.AreEqual (expected.Subcategory ?? "", result.Subcategory, "#subcategory");
			Assert.AreEqual (expected.Code, result.Code, "number");
			Assert.AreEqual (expected.Message ?? "", result.Message, "#message");
		}
Exemplo n.º 2
0
			public TestCaseData (string raw, LogEvent expectedResult)
			{
				Raw = raw;
				ExpectedResult = expectedResult;
			}