[Fat-develop] FAT/src/FAT.Core HtmlDetailsLog.cs,NONE,1.1 FAT.Core.csproj,1.2,1.3 ITestLog.cs,1.1,1.
Brought to you by:
exortech
Update of /cvsroot/fat/FAT/src/FAT.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13246/src/FAT.Core Modified Files: FAT.Core.csproj ITestLog.cs ITestStepResult.cs TestLog.cs TestLogger.cs TestStepInvoker.cs TestStepResult.cs Added Files: HtmlDetailsLog.cs Log Message: Can now add HtmlDetails to TestLogger in FATFixtures. Details are dislayed in test results as clickable thumbnails in FAT.Web --- NEW FILE: HtmlDetailsLog.cs --- using System; namespace FAT.Core { [Serializable] public class HtmlDetailsLog { private string url; private string html; public HtmlDetailsLog(string url, string html) { this.url = url; this.html = html; } public string Url { get {return url;} } public string Html { get {return html;} } } } Index: FAT.Core.csproj =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/FAT.Core.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAT.Core.csproj 14 Dec 2003 21:30:28 -0000 1.2 --- FAT.Core.csproj 28 Jan 2004 22:14:47 -0000 1.3 *************** *** 93,96 **** --- 93,101 ---- /> <File + RelPath = "HtmlDetailsLog.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "IsolatedTestRunner.cs" SubType = "Code" Index: ITestLog.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/ITestLog.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ITestLog.cs 12 Dec 2003 23:28:50 -0000 1.1 --- ITestLog.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- void Log(object message); string Flush(); + HtmlDetailsLog HtmlDetailsLog {set;} + HtmlDetailsLog FlushHtmlDetailsLog(); } } Index: ITestStepResult.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/ITestStepResult.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ITestStepResult.cs 12 Dec 2003 23:28:50 -0000 1.1 --- ITestStepResult.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- string Detail { get; } bool Succeeded { get; } + HtmlDetailsLog HtmlDetailsLog { get; } } } Index: TestLog.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestLog.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestLog.cs 12 Dec 2003 23:28:50 -0000 1.1 --- TestLog.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- { private StringBuilder buffer = new StringBuilder(); + private HtmlDetailsLog htmlDetailsLog; public void Log(object message) *************** *** 19,22 **** --- 20,36 ---- return contents; } + + public HtmlDetailsLog HtmlDetailsLog + { + set {htmlDetailsLog = value;} + } + + public HtmlDetailsLog FlushHtmlDetailsLog() + { + HtmlDetailsLog returnHtmlDetails = htmlDetailsLog; + htmlDetailsLog = null; + return returnHtmlDetails; + } + } } Index: TestLogger.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestLogger.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestLogger.cs 12 Dec 2003 23:28:50 -0000 1.1 --- TestLogger.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 19,22 **** return Instance.Flush(); } ! } } --- 19,32 ---- return Instance.Flush(); } ! ! public static HtmlDetailsLog HtmlDetailsLog ! { ! set {Instance.HtmlDetailsLog = value;} ! } ! ! public static HtmlDetailsLog FlushHtmlDetails() ! { ! return Instance.FlushHtmlDetailsLog(); ! } ! } } Index: TestStepInvoker.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestStepInvoker.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestStepInvoker.cs 12 Dec 2003 23:28:50 -0000 1.1 --- TestStepInvoker.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 61,65 **** private ITestStepResult TestStepSuccessful(ITestStep testStep) { ! return new TestStepResult(testStep, TestStatus.Succeeded, TestLogger.Flush()); } --- 61,65 ---- private ITestStepResult TestStepSuccessful(ITestStep testStep) { ! return new TestStepResult(testStep, TestStatus.Succeeded, TestLogger.Flush(), TestLogger.FlushHtmlDetails()); } *************** *** 68,72 **** string message = ex.InnerException.Message.Trim(); string detail = ex.InnerException.ToString(); ! return new TestStepResult(testStep, TestStatus.Failed, message, detail); } } --- 68,72 ---- string message = ex.InnerException.Message.Trim(); string detail = ex.InnerException.ToString(); ! return new TestStepResult(testStep, TestStatus.Failed, message, detail, TestLogger.FlushHtmlDetails()); } } Index: TestStepResult.cs =================================================================== RCS file: /cvsroot/fat/FAT/src/FAT.Core/TestStepResult.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestStepResult.cs 12 Dec 2003 23:28:50 -0000 1.1 --- TestStepResult.cs 28 Jan 2004 22:14:48 -0000 1.2 *************** *** 10,19 **** private string message; private string detail; ! public TestStepResult(ITestStep testStep, TestStatus testStatus) : this(testStep, testStatus, null, null) { } ! public TestStepResult(ITestStep testStep, TestStatus testStatus, string message) : this(testStep, testStatus, message, null) { } ! public TestStepResult(ITestStep testStep, TestStatus testStatus, string message, string detail) { this.testStep = testStep; --- 10,24 ---- private string message; private string detail; + private HtmlDetailsLog htmlDetailsLog; ! public TestStepResult(ITestStep testStep, TestStatus testStatus) : this(testStep, testStatus, null, null, null) { } ! public TestStepResult(ITestStep testStep, TestStatus testStatus, string message) : this(testStep, testStatus, message, null, null) { } ! public TestStepResult(ITestStep testStep, TestStatus testStatus, string message, HtmlDetailsLog htmlDetailsLog) : this(testStep, testStatus, message, null, htmlDetailsLog) { } ! ! public TestStepResult(ITestStep testStep, TestStatus testStatus, string message, string detail) : this(testStep, testStatus, message, detail, null) { } ! ! public TestStepResult(ITestStep testStep, TestStatus testStatus, string message, string detail, HtmlDetailsLog htmlDetailsLog) { this.testStep = testStep; *************** *** 21,24 **** --- 26,30 ---- this.message = message; this.detail = detail; + this.htmlDetailsLog = htmlDetailsLog; } *************** *** 52,55 **** --- 58,66 ---- get { return testStatus == TestStatus.Succeeded; } } + + public HtmlDetailsLog HtmlDetailsLog + { + get { return htmlDetailsLog; } + } } } |