nspec / NSpec

A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.
http://nspec.org/
MIT License
260 stars 57 forks source link

XUnitFormatter is not writing all the data to the file/console #177

Closed BennieCopeland closed 7 years ago

BennieCopeland commented 7 years ago

Testing the code, the XmlWriter is not flushing its contents to the StringWriter before being written to the results.

contexts.Do(c => this.BuildContext(xmlWrapper, c));
xml.WriteEndElement();
// xml.Flush() needs to be called here
var results = sb.ToString();
bool didWriteToFile = false;

Needs to be added after line 28 of XUnitFormatter.cs.