Skip to content
Browse files

Changes to the reporting aspect

  • Loading branch information...
1 parent b53bc5d commit 346dd4a8049c1fa1f21dc07748f98628199527e0 @BenHall committed Jun 15, 2009
View
BIN Libs/xunit.console.exe
Binary file not shown.
View
21 Libs/xunit.console.exe.config
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+
+ <configSections>
+ <section name="xunit" type="Xunit.ConsoleClient.XunitConsoleConfigurationSection, xunit.console"/>
+ </configSections>
+
+ <xunit>
+ <transforms>
+ <add
+ commandline="html"
+ xslfile="HTML.xslt"
+ description="output results to HTML file"/>
+ <add
+ commandline="nunit"
+ xslfile="NUnitXml.xslt"
+ description="output results to NUnit-style XML file"/>
+ </transforms>
+ </xunit>
+
+</configuration>
View
BIN Libs/xunit.runner.utility.dll
Binary file not shown.
View
2 xUnit.GWT/CustomResults/PendingResult.cs
@@ -10,7 +10,7 @@ namespace xUnit.GWT.CustomResults
public class PendingResult : SkipResult
{
public PendingResult(MethodInfo method, string name)
- : base(name, "Pending", name, new Dictionary<string, string>(), name + " is still pending to be implemented...")
+ : base(method.Name, "Pending", name, new Dictionary<string, string>(), name + " is still pending to be implemented...")
{}
public override XmlNode ToXml(XmlNode parentNode)
View
49 xUnit.GWT/Example/ExampleTestRun.xml
@@ -1,8 +1,47 @@
-<assembly name="C:\Documents and Settings\ben.hall\My Documents\Visual Studio 2008\Projects\xUnit.GWT\xUnit.GWT\bin\Debug\xUnit.GWT.DLL" run-date="2009-05-08" run-time="10:46:28" time="0.026" total="4" passed="1" failed="2" skipped="1"><class story="As a User... I want To... so that I..." time="0.026" name="xUnit.GWT.This_is_my_story" total="4" passed="1" failed="2" skipped="1"><test name=" Given a block which has been defined When no action assigned Then it should be marked as pending" type="Pending" method=" Given a block which has been defined When no action assigned Then it should be marked as pending" result="Pending"><reason><message><![CDATA[ Given a block which has been defined When no action assigned Then it should be marked as pending is still pending to be implemented...]]></message></reason><reason><message><![CDATA[ Given a block which has been defined When no action assigned Then it should be marked as pending is still pending to be implemented...]]></message></reason></test><test name=" Given one valid given block When there is no then block [then it should fail]" type="xUnit.GWT.This_is_my_story" method="part_is_missing" result="Fail" reason="Part Missing" time="0.004"><failure exception-type="xUnit.GWT.PartMissing"><message><![CDATA[xUnit.GWT.PartMissing : Must have at least one type of then]]></message></failure><failure><message>Must have at least one type of then</message></failure></test><test name=" Given both accounts have positive balances When transfer money from a to b Then a should have the total balance of b and balance of b should be 0" type="xUnit.GWT.This_is_my_story" method="when_transferring_between_two_accounts" time="0.005" result="Pass" /><test name=" Given both accounts have positive balances When transfer money from a to b Then a should have the total balance of b and balance of b should be 0" type="xUnit.GWT.This_is_my_story" method="if_then_is_wrong_then_it_should_fail" result="Fail" reason="Part Missing" time="0.012"><failure exception-type="xUnit.GWT.PartFailed"><message><![CDATA[xUnit.GWT.PartFailed : Then balance of b should be 0 failed to complete successfully
+<assembly name="D:\SourceControl\xUnit.GWT\xUnit.GWT\bin\Debug\xUnit.GWT.DLL" run-date="2009-06-15" run-time="11:49:33" time="0.023" total="5" passed="1" failed="1" skipped="3">
+ <class story="As a user... I want to... So that I..." time="0.023" name="xUnit.GWT.Example.This_is_my_story" total="5" passed="1" failed="1" skipped="3">
+ <test name=" Given a block which has been defined When no action assigned Then it should be marked as pending" type="Pending" method="pending_block" result="Pending">
+ <reason>
+ <message><![CDATA[ Given a block which has been defined When no action assigned Then it should be marked as pending is still pending to be implemented...]]></message>
+ </reason>
+ <reason>
+ <message><![CDATA[ Given a block which has been defined When no action assigned Then it should be marked as pending is still pending to be implemented...]]></message>
+ </reason>
+ </test>
+ <test name=" Given both accounts have positive balances When transfer money from a to b Then a should have the total balance of b and balance of b should be 0" type="xUnit.GWT.Example.This_is_my_story" method="if_then_is_wrong_then_it_should_fail" result="Fail" reason="Part Missing" time="0.017">
+ <failure exception-type="xUnit.GWT.PartFailed">
+ <message>
+ <![CDATA[xUnit.GWT.PartFailed : Then balance of b should be 0 failed to complete successfully
---- Assert.Equal() Failure
Expected: 3
-Actual: 0]]></message><stack-trace><![CDATA[
+Actual: 0]]>
+ </message>
+ <stack-trace>
+ <![CDATA[
----- Inner Stack Trace -----
- at xUnit.GWT.XUnitExtensions.ShouldBe[T](T actual, T expected) in C:\Documents and Settings\ben.hall\My Documents\Visual Studio 2008\Projects\xUnit.GWT\xUnit.GWT\XUnitExtensions.cs:line 10
- at xUnit.GWT.This_is_my_story.<if_then_is_wrong_then_it_should_fail>b__f() in C:\Documents and Settings\ben.hall\My Documents\Visual Studio 2008\Projects\xUnit.GWT\xUnit.GWT\This_is_my_story.cs:line 24
- at xUnit.GWT.GwtTestCommand.ExecuteThenPart(List`1 parts) in C:\Documents and Settings\ben.hall\My Documents\Visual Studio 2008\Projects\xUnit.GWT\xUnit.GWT\GwtTestCommand.cs:line 95]]></stack-trace></failure><failure /></test></class></assembly>
+ at xUnit.GWT.XUnitExtensions.ShouldBe[T](T actual, T expected) in D:\SourceControl\xUnit.GWT\xUnit.GWT\XUnitExtensions.cs:line 10
+ at xUnit.GWT.Example.This_is_my_story.<if_then_is_wrong_then_it_should_fail>b__7() in D:\SourceControl\xUnit.GWT\xUnit.GWT\Example\This_is_my_story.cs:line 24
+ at xUnit.GWT.GwtTestCommand.ExecuteThenPart(List`1 parts) in D:\SourceControl\xUnit.GWT\xUnit.GWT\GwtTestCommand.cs:line 103]]>
+ </stack-trace>
+ </failure>
+ <failure />
+ </test>
+ <test name=" Given one valid given block When there is no then block [then it should fail]" type="Pending" method="part_is_missing" result="Pending">
+ <reason>
+ <message><![CDATA[ Given one valid given block When there is no then block [then it should fail] is still pending to be implemented...]]></message>
+ </reason>
+ <reason>
+ <message><![CDATA[ Given one valid given block When there is no then block [then it should fail] is still pending to be implemented...]]></message>
+ </reason>
+ </test>
+ <test name=" Given one pending block Then it should be marked as pending in the report" type="Pending" method="test_marked_as_pending" result="Pending">
+ <reason>
+ <message><![CDATA[ Given one pending block Then it should be marked as pending in the report is still pending to be implemented...]]></message>
+ </reason>
+ <reason>
+ <message><![CDATA[ Given one pending block Then it should be marked as pending in the report is still pending to be implemented...]]></message>
+ </reason>
+ </test>
+ <test name=" Given both accounts have positive balances When transfer money from a to b Then a should have the total balance of b and balance of b should be 0" type="xUnit.GWT.Example.This_is_my_story" method="when_transferring_between_two_accounts" time="0.000" result="Pass" />
+ </class>
+</assembly>
View
58 xUnit.GWT/Example/HtmlReporter.htm
@@ -1,10 +1,7 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html><head>
-
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>xUnit.net
-Test Results - C:\Documents and Settings\ben.hall\My Documents\Visual
-Studio 2008\Projects\xUnit.GWT\xUnit.GWT\bin\Debug\xUnit.GWT.DLL</title>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
+ <head>
+ <META http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>xUnit.net Test Results - D:\SourceControl\xUnit.GWT\xUnit.GWT\bin\Debug\xUnit.GWT.DLL</title>
<style type="text/css">
body { font-family: Calibri, Verdana, Arial, sans-serif; background-color: White; color: Black; }
h2,h3,h5 { margin: 0; padding: 0; }
@@ -23,6 +20,7 @@
.indent { margin: 0.25em 0 0.5em 2em; }
.clickable { cursor: pointer; }
.testcount { font-size: 85%; }
+ blockquote { height: 0px; }
</style><script language="javascript">
function ToggleClass(id) {
var elem = document.getElementById(id);
@@ -31,41 +29,35 @@
else
elem.style.display = "none";
}
- </script></head><body>
+ </script></head>
+ <body>
<h4>
-Results for C:\Documents and Settings\ben.hall\My Documents\Visual
-Studio 2008\Projects\xUnit.GWT\xUnit.GWT\bin\Debug\xUnit.GWT.DLL<br><span><small>
+ Results for D:\SourceControl\xUnit.GWT\xUnit.GWT\bin\Debug\xUnit.GWT.DLL<br><span><small>
Scenarios run:
- <b>4</b> &nbsp;
+ <b>5</b>  
Failures:
- <b>2</b>,
- Pending:
<b>1</b>,
- Run time: <b>0.026s
+ Pending:
+ <b>3</b>,
+ Run time: <b>0.023s
</b></small></span></h4>
- <h3><span class="timing">0.026s</span><span class="clickable" onclick="ToggleClass('class1')" ondblclick="ToggleClass('class1')"><b>
- Story - As a User... I want To... so that I...</b><span><small>
+ <h3><span class="timing">0.023s</span><span class="clickable" onclick="ToggleClass('class1')" ondblclick="ToggleClass('class1')"><b>
+ Feature - As a user... I want to... So that I...</b><span><small>
Scenarios run:
- <b>4</b>&nbsp;
+ <b>5</b> 
Failures:
- <b>2</b>,
+ <b>1</b>,
Pending:
- <b>1</b></small></span></span><br clear="all"></h3>
+ <b>3</b></small></span></span><br clear="all"></h3>
<div class="indent" id="class1">
- <div class="row"><span class="timing"></span><span class="skipped">P</span>
- &nbsp; Given a block which has been defined When no action assigned Then it should be marked as pending<br clear="all"></div>
- <div class="altrow"><span class="timing">0.005s</span><span class="success"><img src="..\Passed.png"></span>
-&nbsp; Given both accounts have positive balances When transfer money
-from a to b Then a should have the total balance of b and balance of b
-should be 0<br clear="all"></div>
- <div class="row"><span class="timing">0.012s</span><span class="failure"><img src="..\Failed.png"></span>
-&nbsp; Given both accounts have positive balances When transfer money
-from a to b Then a should have the total balance of b and balance of b
-should be 0<br><blockquote>xUnit.GWT.PartFailed : Then balance of b should be 0 failed to complete successfully
+ <div class="row"><span class="skipped"> P</span> Given a block which has been defined When no action assigned Then it should be marked as pending<br clear="all"></div>
+ <div class="altrow"><span class="timing">0.017s</span><span class="failure"><img src="../Failed.png"></span> Given both accounts have positive balances When transfer money from a to b Then a should have the total balance of b and balance of b should be 0<blockquote>xUnit.GWT.PartFailed : Then balance of b should be 0 failed to complete successfully
---- Assert.Equal() Failure
Expected: 3
Actual: 0</blockquote><br clear="all"></div>
- <div class="altrow"><span class="timing">0.004s</span><span class="failure"><img src="..\Failed.png"></span>
- &nbsp; Given one valid given block When there is no then block [then it should fail]<br><blockquote>xUnit.GWT.PartMissing : Must have at least one type of then</blockquote><br clear="all"></div>
- </div><br><h5>Results generated 2009-05-08 at 10:46:28</h5>
- </body></html>
+ <div class="row"><span class="timing">0.000s</span><span class="success"><img src="../Passed.png"></span> Given both accounts have positive balances When transfer money from a to b Then a should have the total balance of b and balance of b should be 0<br clear="all"></div>
+ <div class="altrow"><span class="skipped"> P</span> Given one pending block Then it should be marked as pending in the report<br clear="all"></div>
+ <div class="row"><span class="skipped"> P</span> Given one valid given block When there is no then block [then it should fail]<br clear="all"></div>
+ </div><br><h5>Results generated 2009-06-15 at 11:49:33</h5>
+ </body>
+</html>
View
BIN xUnit.GWT/Example/Screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 xUnit.GWT/Example/This_is_my_story.cs
@@ -27,8 +27,8 @@ public void if_then_is_wrong_then_it_should_fail()
[Scenario]
public void part_is_missing()
{
- Given("one valid given block", Pending);
- When("there is no then block [then it should fail]", Pending);
+ Given("one valid 'given' block", Pending);
+ When("there is no 'then' block [it should fail]", Pending);
//Then("it should fail");
}
@@ -43,7 +43,7 @@ public void test_marked_as_pending()
public void pending_block()
{
Given("a block which has been defined");
- When("no action assigned", Pending);
+ When("no action assigned");
Then("it should be marked as pending");
}
}
View
6 xUnit.GWT/GwtTestCommand.cs
@@ -68,11 +68,11 @@ public MethodResult Execute(object testClass)
private string GetName()
{
string name = string.Empty;
- name = GetNameSection(name, GivenList, "Given");
+ name = GetNameSection(name, GivenList, "Given") + Environment.NewLine;
- name = GetNameSection(name, WhenList, "When");
+ name = GetNameSection(name, WhenList, "When") + Environment.NewLine;
- name = GetNameSection(name, ThenList, "Then");
+ name = GetNameSection(name, ThenList, "Then") + Environment.NewLine;
return name;
}
View
13 xUnit.GWT/HtmlReporter.xslt
@@ -29,6 +29,7 @@
.indent { margin: 0.25em 0 0.5em 2em; }
.clickable { cursor: pointer; }
.testcount { font-size: 85%; }
+ blockquote { height: 0px; }
</style>
<script language="javascript">
function ToggleClass(id) {
@@ -76,15 +77,13 @@
<div>
<xsl:attribute name="class"><xsl:if test="(position() mod 2 = 0)">alt</xsl:if>row</xsl:attribute>
<xsl:if test="@result!='Pending'"><span class="timing"><xsl:value-of select="@time"/>s</span></xsl:if>
- <xsl:if test="@result='Pending'"><span class="timing"></span><span class="skipped">P</span></xsl:if>
- <xsl:if test="@result='Fail'"><span class="failure">
- <img src="Failed.png" />
- </span></xsl:if>
+ <xsl:if test="@result='Pending'"><span class="skipped"> P</span></xsl:if>
+ <xsl:if test="@result='Fail'"><span class="failure"><img src="Failed.png" /></span></xsl:if>
<xsl:if test="@result='Pass'"><span class="success"><img src="Passed.png" /></span></xsl:if>
- &#160;<xsl:value-of select="@name"/>
+ <xsl:value-of select="@name"/>
<xsl:if test="@result='Fail'">
- <br/>
- <blockquote> <xsl:value-of select="child::node()/message"/>
+ <blockquote>
+ <xsl:value-of select="child::node()/message"/>
</blockquote>
</xsl:if>
<br clear="all" />

0 comments on commit 346dd4a

Please sign in to comment.
Something went wrong with that request. Please try again.