Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

namespace Microsoft.DotNet.TemplateLocator.Tests
{
[TestClass]
public class GivenAnTemplateLocator : SdkTest
{
private readonly TemplateLocator _resolver;
private readonly string _manifestDirectory;
private readonly string _fakeDotnetRootDirectory;

public GivenAnTemplateLocator(ITestOutputHelper logger) : base(logger)
public GivenAnTemplateLocator()
{
_resolver = new TemplateLocator(Environment.GetEnvironmentVariable, null, VSSettings.Ambient, null, null);
_fakeDotnetRootDirectory =
Expand All @@ -28,7 +29,7 @@ public GivenAnTemplateLocator(ITestOutputHelper logger) : base(logger)

}

[Fact]
[TestMethod]
public void ItShouldReturnListOfTemplates()
{
Directory.CreateDirectory(Path.Combine(_manifestDirectory, "Android"));
Expand All @@ -49,7 +50,7 @@ public void ItShouldReturnListOfTemplates()
result.Should().HaveCount(1);
}

[Fact]
[TestMethod]
public void GivenNoSdkToBondItShouldReturnEmpty()
{
Directory.CreateDirectory(Path.Combine(_manifestDirectory, "Android"));
Expand All @@ -60,7 +61,7 @@ public void GivenNoSdkToBondItShouldReturnEmpty()
result.Should().BeEmpty();
}

[Fact]
[TestMethod]
public void GivenNoManifestDirectoryItShouldReturnEmpty()
{
var fakeDotnetRootDirectory =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSTest.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;$(SdkTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'false' ">$(SdkTargetFramework)</TargetFrameworks>
<!-- For product build, the .NET Framework TFM only builds in the second build pass as it depends on assets from other
verticals that are built in the first build pass. -->
<TargetFrameworks Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">$(SdkTargetFramework)</TargetFrameworks>
<OutputType Condition="'$(TargetFramework)' == '$(SdkTargetFramework)'">Exe</OutputType>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>

<!-- By default test projects don't append TargetFramework to output path, but for multi-targeted tests
Expand All @@ -18,7 +17,11 @@
<ProjectReference Include="..\..\src\Microsoft.DotNet.TemplateLocator\Microsoft.DotNet.TemplateLocator.csproj" />
<ProjectReference Include="..\..\src\Resolvers\Microsoft.DotNet.SdkResolver\Microsoft.DotNet.SdkResolver.csproj" />
<ProjectReference Include="..\..\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\Microsoft.NET.Sdk.WorkloadManifestReader.csproj" />
<ProjectReference Include="..\Microsoft.NET.TestFramework\Microsoft.NET.TestFramework.csproj" />
<ProjectReference Include="..\Microsoft.NET.TestFramework.MSTest\Microsoft.NET.TestFramework.MSTest.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="Microsoft.NET.TestFramework" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading