45 using System.Collections.Generic;
54 string BlanksBefore =
string.Empty;
58 int myFileCounter = 0;
67 this.myPathAndFile = PathAndFile;
68 this.myFile =
new StreamWriter(this.myPathAndFile,
false);
71 this.WriteHTMLHeader();
76 this.WriteHTMLFooter();
79 #endregion Constructors
92 this.WriteBlockOpen(
"Error",
"Error");
101 this.WriteBlockClose();
114 this.WriteBlockOpen(
"Exception",
"Exception");
123 this.WriteBlockClose();
136 this.WriteBlockClose();
151 this.
LogPrint(
"\"" + fps_Return +
"\"");
154 this.WriteBlockClose();
170 this.
LogPrint(
"\"" + fpsBoolean +
"\"");
173 this.WriteBlockClose();
189 foreach (
string Value
in fpls_Return)
196 this.WriteBlockClose();
210 this.WriteBlockOpen(
"Method: " + fps_FunctionName,
"Method");
213 for (
int i = 0; i < fpsParameter.Length; i += 2)
215 this.
LogPrint(fpsParameter[i] +
" = \"" + fpsParameter[i + 1] +
"\"");
233 this.WriteBlockClose();
244 String String2Print = fps_KeyWordName;
247 if (fpsParameter.Length == 0)
250 String2Print = String2Print +
"()";
253 else if (fpsParameter.Length == 1)
255 String2Print = String2Print +
": \"" + fpsParameter[0] +
"\"";
258 else if (fpsParameter.Length == 2)
260 String2Print = String2Print +
": \"" + fpsParameter[0] +
"\" = \"" + fpsParameter[1] +
"\"";
265 String2Print = String2Print +
"(\"" + fpsParameter[0] +
"\"";
267 for (
int i = 1; i < fpsParameter.Length; i++)
269 String2Print = String2Print +
", \"" + fpsParameter[i] +
"\"";
272 String2Print = String2Print +
")";
277 this.WriteBlockOpen(String2Print,
"KeyWord");
293 this.myFile.WriteLine(this.BlanksBefore +
"<p>");
294 this.myFile.WriteLine(this.BlanksBefore + fps_Message);
295 this.myFile.WriteLine(this.BlanksBefore +
"</p>");
305 public void LogVerify(
string fps_Actual,
string fps_Expected)
309 if (fps_Actual == fps_Expected)
311 this.WriteBlockOpen(
"Passed",
"Passed");
315 this.WriteBlockOpen(
"Error",
"Error");
321 this.myFile.WriteLine(this.BlanksBefore +
"<p>");
322 this.myFile.WriteLine(this.BlanksBefore +
"<code>Expected = " + fps_Expected +
"</code><br/>");
323 this.myFile.WriteLine(this.BlanksBefore +
"<code> Actual = " + fps_Actual +
"</code>");
324 this.myFile.WriteLine(this.BlanksBefore +
"</p>");
329 this.WriteBlockClose();
343 this.WriteBlockOpen(
"Warning",
"Warning");
352 this.WriteBlockClose();
363 if (this.LevelCounter > 0)
369 this.LevelCounter = 0;
370 throw new System.DivideByZeroException();
376 this.WriteBlockClose();
390 this.WriteBlockOpen(fps_Name,
"Normal");
405 this.BlanksBefore =
new string(
'\t', this.LevelCounter);
408 private void FileClose()
410 this.myFileCounter--;
412 if (this.myFileCounter <= 0)
414 this.myFileCounter = 0;
420 private void FileOpen()
422 if (this.myFileCounter <= 0)
424 this.myFileCounter = 1;
425 this.myFile =
new StreamWriter(this.myPathAndFile,
true);
429 this.myFileCounter++;
433 private void WriteBlockClose()
435 this.myFile.Write(this.BlanksBefore);
436 this.myFile.WriteLine(
"</blockquote>");
439 private void WriteBlockOpen(
string fpsWert,
string fpsHTMLClass)
441 this.myFile.Write(this.BlanksBefore);
442 this.myFile.WriteLine(
"<blockquote class=\"" + fpsHTMLClass +
"\" id=\"IDOpen" + this.ID.ToString() +
"\" style=\"display:block;\">");
444 this.myFile.Write(this.BlanksBefore);
445 this.myFile.WriteLine(
"\t<a onclick=\"(document.getElementById('IDOpen" + this.ID.ToString() +
"')).style.display='none';(document.getElementById('IDClose" + this.ID.ToString() +
"')).style.display='block';\"> + " + fpsWert +
"...</a>");
447 this.myFile.Write(this.BlanksBefore);
448 this.myFile.WriteLine(
"</blockquote>");
450 this.myFile.Write(this.BlanksBefore);
451 this.myFile.WriteLine(
"<blockquote class=\"" + fpsHTMLClass +
"\" id=\"IDClose" + this.ID.ToString() +
"\" style=\"display:none;\">");
453 this.myFile.Write(this.BlanksBefore);
454 this.myFile.WriteLine(
"<a onclick=\"(document.getElementById('IDOpen" + this.ID.ToString() +
"')).style.display='block';(document.getElementById('IDClose" + this.ID.ToString() +
"')).style.display='none';\"> - " + fpsWert +
"</a><br/>");
456 this.ID = this.ID + 1;
459 private void WriteHTMLFooter()
463 this.myFile.WriteLine(
"</body>");
464 this.myFile.WriteLine(
"</html>");
469 private void WriteHTMLHeader()
473 this.myFile.WriteLine(
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
474 this.myFile.WriteLine(
"<html xmlns=\"http://www.w3.org/1999/xhtml\" >");
476 this.myFile.WriteLine(
"<head>");
477 this.myFile.WriteLine(
"\t<title>TestPage Titel</title>");
478 this.myFile.WriteLine(
"\t<link href=\"Log2HTMLFile.css\" type=\"text/css\" rel=\"stylesheet\"></link>");
479 this.myFile.WriteLine(
"</head>");
480 this.myFile.WriteLine(
"<body>");
Klasse enthält OKW-Hilfsfunktionen.
void LogKeyWordStart(string fps_KeyWordName, params string[] fpsParameter)
void LogWarning(string fps_Message)
LogWarning Function: Logs a warning to the results file.
void ResCloseList()
Closes the outline level.
void LogPrint(string fps_Message)
LogPrint Function: Prints the values of expressions to the results file.
void LogException(string fps_Message)
LogException Function: Logs a Script Exception to the results file.
void LogFunctionEnd(string fps_Return)
void LogFunctionStart(string fps_FunctionName, params string[] fpsParameter)
void ResOpenList(string fps_Name)
void LogFunctionEnd(bool fpb_Return)
Debug Logs are not a part of Interface. This functions are Implemented in Logger.cs a Log*Debug funct...
void LogError(string fps_Message)
LogError Function: Logs an error message to the results file.
void LogVerify(string fps_Actual, string fps_Expected)
void LogFunctionEnd(List< string > fpls_Return)
static string Boolean2String(bool fpbTrueOrFalse)
Konvertiert bool true/false nach string "true"/"false".