Skip to content

Commit 8f1d3e5

Browse files
committed
Adjust tests
1 parent 2b7afcf commit 8f1d3e5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Packages/com.unity.ide.visualstudio.tests/Tests/Editor/CSProjectTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ public void DllInSourceFiles_WillBeAddedAsReference()
906906
XmlDocument scriptProject = XMLUtilities.FromText(csprojFileContents);
907907
XMLUtilities.AssertCompileItemsMatchExactly(scriptProject, new[] { "file.cs" });
908908
XMLUtilities.AssertNonCompileItemsMatchExactly(scriptProject, new string[0]);
909-
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"reference\">\\W*<HintPath>{referenceDll}\\W*</HintPath>\\W*</Reference>"));
909+
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"reference\">\\W*<HintPath>{referenceDll}\\W*</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
910910
}
911911

912912
[Test]
@@ -921,7 +921,7 @@ public void Containing_PathWithSpaces_IsParsedCorrectly()
921921
synchronizer.Sync();
922922

923923
var csprojFileContents = m_Builder.ReadProjectFile(m_Builder.Assembly);
924-
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"Goodbye\">\\W*<HintPath>{Regex.Escape(fullPathReferences[0].ReplaceDirectorySeparators())}\\W*</HintPath>\\W*</Reference>"));
924+
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"Goodbye\">\\W*<HintPath>{Regex.Escape(fullPathReferences[0].ReplaceDirectorySeparators())}\\W*</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
925925
}
926926

927927
[Test]
@@ -950,8 +950,8 @@ public void Multiple_AreAdded()
950950

951951
var csprojFileContents = m_Builder.ReadProjectFile(m_Builder.Assembly);
952952

953-
Assert.IsTrue(csprojFileContents.MatchesRegex("<Reference Include=\"Hello\">\\W*<HintPath>Hello.dll</HintPath>\\W*</Reference>"));
954-
Assert.IsTrue(csprojFileContents.MatchesRegex("<Reference Include=\"MyPlugin\">\\W*<HintPath>MyPlugin.dll</HintPath>\\W*</Reference>"));
953+
Assert.IsTrue(csprojFileContents.MatchesRegex("<Reference Include=\"Hello\">\\W*<HintPath>Hello.dll</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
954+
Assert.IsTrue(csprojFileContents.MatchesRegex("<Reference Include=\"MyPlugin\">\\W*<HintPath>MyPlugin.dll</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
955955
}
956956

957957
[Test]
@@ -988,8 +988,8 @@ public void AssemblyReferenceFromInternalizedPackage_IsAddedAsReference()
988988
var csprojFileContents = m_Builder.ReadProjectFile(m_Builder.Assembly);
989989
Assert.That(csprojFileContents, Does.Not.Match($@"<ProjectReference Include=""{assemblyReferences[0].name}\.csproj"">[\S\s]*?</ProjectReference>"));
990990
Assert.That(csprojFileContents, Does.Not.Match($@"<ProjectReference Include=""{assemblyReferences[1].name}\.csproj"">[\S\s]*?</ProjectReference>"));
991-
Assert.That(csprojFileContents, Does.Match($"<Reference Include=\"{assemblyReferences[0].name}\">\\W*<HintPath>{Regex.Escape(assemblyReferences[0].outputPath.ReplaceDirectorySeparators())}</HintPath>\\W*</Reference>"));
992-
Assert.That(csprojFileContents, Does.Match($"<Reference Include=\"{assemblyReferences[1].name}\">\\W*<HintPath>{Regex.Escape(assemblyReferences[1].outputPath.ReplaceDirectorySeparators())}</HintPath>\\W*</Reference>"));
991+
Assert.That(csprojFileContents, Does.Match($"<Reference Include=\"{assemblyReferences[0].name}\">\\W*<HintPath>{Regex.Escape(assemblyReferences[0].outputPath.ReplaceDirectorySeparators())}</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
992+
Assert.That(csprojFileContents, Does.Match($"<Reference Include=\"{assemblyReferences[1].name}\">\\W*<HintPath>{Regex.Escape(assemblyReferences[1].outputPath.ReplaceDirectorySeparators())}</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
993993
}
994994

995995
[Test]
@@ -1005,8 +1005,8 @@ public void CompiledAssemblyReference_IsAdded()
10051005
synchronizer.Sync();
10061006

10071007
var csprojFileContents = m_Builder.ReadProjectFile(m_Builder.Assembly);
1008-
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"Hello\">\\W*<HintPath>{Regex.Escape(compiledAssemblyReferences[0])}</HintPath>\\W*</Reference>"));
1009-
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"MyPlugin\">\\W*<HintPath>{Regex.Escape(compiledAssemblyReferences[1])}</HintPath>\\W*</Reference>"));
1008+
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"Hello\">\\W*<HintPath>{Regex.Escape(compiledAssemblyReferences[0])}</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
1009+
Assert.IsTrue(csprojFileContents.MatchesRegex($"<Reference Include=\"MyPlugin\">\\W*<HintPath>{Regex.Escape(compiledAssemblyReferences[1])}</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
10101010
}
10111011

10121012
[Test]
@@ -1018,7 +1018,7 @@ public void ProjectReference_FromLibraryReferences_IsAdded()
10181018
synchronizer.Sync();
10191019

10201020
var csprojFileContents = m_Builder.ReadProjectFile(m_Builder.Assembly);
1021-
Assert.IsFalse(csprojFileContents.MatchesRegex($"<Reference Include=\"{projectAssembly.name}\">\\W*<HintPath>{Regex.Escape(projectAssembly.outputPath.ReplaceDirectorySeparators())}</HintPath>\\W*</Reference>"));
1021+
Assert.IsFalse(csprojFileContents.MatchesRegex($"<Reference Include=\"{projectAssembly.name}\">\\W*<HintPath>{Regex.Escape(projectAssembly.outputPath.ReplaceDirectorySeparators())}</HintPath>\\W*<Private>False</Private>\\W*</Reference>"));
10221022
}
10231023

10241024
[Test]

0 commit comments

Comments
 (0)