Skip to content

Commit fd97481

Browse files
committed
Add unit-test for DebugSymbolsFiles
1 parent 97b2866 commit fd97481

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net46</TargetFramework>
6+
<PublishReferencesDocumentationFiles>true</PublishReferencesDocumentationFiles>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="NServiceBus" Version="6.4.0" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System;
5+
6+
namespace TestApp
7+
{
8+
class Program
9+
{
10+
static void Main()
11+
{
12+
Console.WriteLine("Hello World");
13+
}
14+
}
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net46</TargetFramework>
6+
<PublishReferencesDocumentationFiles>false</PublishReferencesDocumentationFiles>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="NServiceBus" Version="6.4.0" />
11+
</ItemGroup>
12+
13+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System;
5+
6+
namespace TestApp
7+
{
8+
class Program
9+
{
10+
static void Main()
11+
{
12+
Console.WriteLine("Hello World");
13+
}
14+
}
15+
}

src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExe.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,50 @@ public void It_places_package_satellites_correctly(bool crossTarget)
830830
outputDirectory.Should().HaveFile(@"fr\FluentValidation.resources.dll");
831831
}
832832

833+
[WindowsOnlyFact]
834+
public void It_places_package_pdb_file_correctly()
835+
{
836+
var testAsset = _testAssetsManager
837+
.CopyTestAsset(
838+
"DesktopUsingPackageWithPdb")
839+
.WithSource();
840+
841+
testAsset.Restore(Log);
842+
843+
var buildCommand = new BuildCommand(Log, testAsset.TestRoot);
844+
buildCommand
845+
.Execute()
846+
.Should()
847+
.Pass();
848+
849+
var outputDirectory = buildCommand.GetOutputDirectory("net46");
850+
outputDirectory.Should().HaveFile("NServiceBus.Core.dll");
851+
outputDirectory.Should().HaveFile("NServiceBus.Core.pdb");
852+
outputDirectory.Should().HaveFile("NServiceBus.Core.xml");
853+
}
854+
855+
[WindowsOnlyFact]
856+
public void It_places_package_pdb_without_xml_file_correctly()
857+
{
858+
var testAsset = _testAssetsManager
859+
.CopyTestAsset(
860+
"DesktopUsingPackageWithPdbWithoutXml")
861+
.WithSource();
862+
863+
testAsset.Restore(Log);
864+
865+
var buildCommand = new BuildCommand(Log, testAsset.TestRoot);
866+
buildCommand
867+
.Execute()
868+
.Should()
869+
.Pass();
870+
871+
var outputDirectory = buildCommand.GetOutputDirectory("net46");
872+
outputDirectory.Should().HaveFile("NServiceBus.Core.dll");
873+
outputDirectory.Should().HaveFile("NServiceBus.Core.pdb");
874+
outputDirectory.Should().NotHaveFile("NServiceBus.Core.xml");
875+
}
876+
833877
[WindowsOnlyFact(Skip = "https://github.com/NuGet/Home/issues/6823")]
834878
public void It_allows_TargetFrameworkVersion_to_be_capitalized()
835879
{

0 commit comments

Comments
 (0)