Fixing the failing test by using a package that is not part of the asp.net runtime.

This commit is contained in:
Livar Cunha 2017-05-02 12:37:29 -07:00
parent 5a6efef0e2
commit 9387702b7a
7 changed files with 16 additions and 22 deletions

View file

@ -1,3 +0,0 @@
<StoreArtifacts>
<Package Id="Newtonsoft.Json" Version ="9.0.1"/>
</StoreArtifacts>

View file

@ -1,5 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version ="9.0.1"/>
</ItemGroup>
</Project>

View file

@ -6,6 +6,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NewtonSoft.Json" Version="9.0.1" /> <PackageReference Include="NuGet.Configuration" Version="4.3.0-beta1-2418" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -3,20 +3,14 @@
using System; using System;
using System.Collections; using System.Collections;
using Newtonsoft.Json.Linq; using NuGet.Configuration;
class Program class Program
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
ArrayList argList = new ArrayList(args); var settingValue = new SettingValue("key", "value", false);
JObject jObject = new JObject();
foreach (string arg in argList) Console.WriteLine(settingValue.Key);
{
jObject[arg] = arg;
}
Console.WriteLine(jObject.ToString());
} }
} }

View file

@ -0,0 +1,3 @@
<StoreArtifacts>
<Package Id="NuGet.Configuration" Version ="4.3.0-beta1-2418"/>
</StoreArtifacts>

View file

@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="NuGet.Configuration" Version ="4.3.0-beta1-2418"/>
</ItemGroup>
</Project>

View file

@ -70,9 +70,9 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
[Fact] [Fact]
public void AppFailsDueToMissingCache() public void AppFailsDueToMissingCache()
{ {
var testAppName = "NewtonSoftDependentProject"; var testAppName = "NuGetConfigDependentProject";
var profileProjectName = "NewtonsoftProfile"; var profileProjectName = "NuGetConfigProfile";
var targetManifestFileName = "NewtonsoftFilterProfile.xml"; var targetManifestFileName = "NuGetConfigFilterProfile.xml";
var testInstance = TestAssets.Get(testAppName) var testInstance = TestAssets.Get(testAppName)
.CreateInstance() .CreateInstance()
@ -102,7 +102,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
new DotnetCommand() new DotnetCommand()
.ExecuteWithCapturedOutput(outputDll) .ExecuteWithCapturedOutput(outputDll)
.Should().Fail() .Should().Fail()
.And.HaveStdErrContaining($"Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with {targetManifestFileName} -- package: 'Newtonsoft.Json',"); .And.HaveStdErrContaining($"Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with {targetManifestFileName} -- package: 'NuGet.Configuration',");
} }
[Fact] [Fact]