2010-12-13 9 views
6

मुझे एक रिपोर्ट के लिए XUnit परीक्षणों से NUnit आउटपुट की आवश्यकता है। NUnit के साथ मैं कर सकते हैं:मैं XUnit कंसोल के साथ NUnit स्वरूपित xml आउटपुट कैसे करूं?

nunit-console.exe /xml=c:\TestResultN.xml MyDll.dll 

मैं कोशिश की है:

xunit.console MyDll.dll /nunit TestResults.xml 

लेकिन मैं मिलता है:

unknown output transform: nunit 

XUnit कंसोल पर कोई अच्छा डॉक्स? मुझे कोई जानकारी नहीं मिल रही है।

उत्तर

19

कंसोल में xunit.console.exe /? टाइप करें और विकल्प सूची के अंत को देखें।

> xunit.console.exe /? 
xUnit.net console test runner (64-bit .NET 2.0.50727.4952) 
Copyright (C) 2007-10 Microsoft Corporation. 

usage: xunit.console <xunitProjectFile> [options] 
usage: xunit.console <assemblyFile> [configFile] [options] 

Valid options: 
    /silent    : do not output running test count 
    /teamcity    : forces TeamCity mode (normally auto-detected) 
    /wait     : wait for input after completion 

Valid options for assemblies only: 
    /noshadow    : do not shadow copy assemblies 
    /xml <filename>  : output results to Xunit-style XML file 
    /html <filename>  : output results to HTML file 
    /nunit <filename>  : output results to NUnit-style XML file 

अंतिम दो विकल्प कॉन्फ़िगरेशन फ़ाइल से निकाले गए हैं और xunit के आउटपुट पर लागू एक xslt फ़ाइल शामिल है। यदि /nunit मौजूद नहीं है, तो सुनिश्चित करें कि आपके पास xunit निर्देशिका में NUnitXml.xslt फ़ाइल है और nunit प्रविष्टि xunit.console.exe.config फ़ाइल में घोषित की गई है।

मेरे xunit.console.exe.config फ़ाइल:

<?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> 

आपको इन फ़ाइलों ढूँढने में सक्षम नहीं हैं, तो आप XUnit पुनर्स्थापित करने के लिए आवश्यकता हो सकती है।

संबंधित मुद्दे