-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tests for new log file tokens
- Loading branch information
Showing
7 changed files
with
103 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
test/NUnit.Xml.TestLogger.AcceptanceTests/NUnitTestLoggerPathTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) Spekt Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace NUnit.Xml.TestLogger.AcceptanceTests | ||
{ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Xml.Linq; | ||
using System.Xml.XPath; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
[TestClass] | ||
public class NUnitTestLoggerPathTests | ||
{ | ||
public NUnitTestLoggerPathTests() | ||
{ | ||
} | ||
|
||
[ClassInitialize] | ||
public static void SuiteInitialize(TestContext context) | ||
{ | ||
DotnetTestFixture.RootDirectory = Path.GetFullPath( | ||
Path.Combine( | ||
Environment.CurrentDirectory, | ||
"..", | ||
"..", | ||
"..", | ||
"..", | ||
"assets", | ||
"NUnit.Xml.TestLogger.NetMulti.Tests")); | ||
DotnetTestFixture.TestAssemblyName = "NUnit.Xml.TestLogger.NetMulti.Tests.dll"; | ||
DotnetTestFixture.Execute("{assembly}.{framework}.test-results.xml"); | ||
} | ||
|
||
[TestMethod] | ||
public void TestRunWithLoggerAndFilePathShouldCreateResultsFile() | ||
{ | ||
string[] expectedResultsFiles = new string[] | ||
{ | ||
Path.Combine(DotnetTestFixture.RootDirectory, "NUnit.Xml.TestLogger.NetMulti.Tests.NetFramework46.test-results.xml"), | ||
Path.Combine(DotnetTestFixture.RootDirectory, "NUnit.Xml.TestLogger.NetMulti.Tests.NetCoreApp20.test-results.xml") | ||
}; | ||
foreach (string resultsFile in expectedResultsFiles) | ||
{ | ||
Assert.IsTrue(File.Exists(resultsFile), $"{resultsFile} does not exist."); | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
test/assets/NUnit.Xml.TestLogger.NetMulti.Tests/NUnit.Xml.TestLogger.NetMulti.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<SourceRoot Condition="$(SourceRoot) == ''">..\..\..\</SourceRoot> | ||
</PropertyGroup> | ||
<Import Project="$(SourceRoot)scripts/settings.targets" /> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks> | ||
<FrameworkPathOverride Condition="'$(OS)' != 'Windows_NT'">/usr/lib/mono/4.5/</FrameworkPathOverride> | ||
|
||
<!-- Disable stylecop for test assets --> | ||
<StylecopEnabled>false</StylecopEnabled> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(NETTestSdkMinimumVersion)" /> | ||
<PackageReference Include="NUnit" Version="$(NUnitVersion)" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" /> | ||
<PackageReference Include="NunitXml.TestLogger" Version="$(PackageVersion)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\NUnit.Xml.TestLogger.NetCore.Tests\UnitTest1.cs"> | ||
<Link>UnitTest1.cs</Link> | ||
</Compile> | ||
<Compile Include="..\NUnit.Xml.TestLogger.NetCore.Tests\UnitTest2.cs"> | ||
<Link>UnitTest2.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
</Project> |