Merge rel/1.0.0 to master
This commit is contained in:
commit
b0a5d53ed5
72 changed files with 3664 additions and 231 deletions
|
@ -2,18 +2,23 @@
|
|||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using FluentAssertions;
|
||||
using Microsoft.Build.Construction;
|
||||
using Microsoft.DotNet.Cli.Sln.Internal;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Package.Add.Tests
|
||||
{
|
||||
public class GivenDotnetPackageAdd : TestBase
|
||||
{
|
||||
private readonly ITestOutputHelper _output;
|
||||
|
||||
public GivenDotnetPackageAdd(ITestOutputHelper output)
|
||||
{
|
||||
_output = output;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenValidPackageIsPassedBeforeVersionItGetsAdded()
|
||||
|
@ -37,6 +42,35 @@ namespace Microsoft.DotNet.Cli.Package.Add.Tests
|
|||
cmd.StdErr.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void
|
||||
WhenValidProjectAndPackageArePassedItGetsAdded()
|
||||
{
|
||||
var testAsset = "TestAppSimple";
|
||||
var projectDirectory = TestAssets
|
||||
.Get(testAsset)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.Root
|
||||
.FullName;
|
||||
|
||||
var csproj = $"{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj";
|
||||
var packageName = "Newtonsoft.Json";
|
||||
var packageVersion = "9.0.1";
|
||||
var cmd = new DotnetCommand()
|
||||
.WithWorkingDirectory(projectDirectory)
|
||||
.ExecuteWithCapturedOutput($"add {csproj} package {packageName} --version {packageVersion}");
|
||||
|
||||
_output.WriteLine($"[STDOUT] {cmd.StdOut}\n[STDERR]{cmd.StdErr}\n");
|
||||
|
||||
cmd.Should().Pass();
|
||||
|
||||
cmd.StdOut.Should()
|
||||
.Contain($"PackageReference for package \'{packageName}\' version \'{packageVersion}\' added to file '{csproj}'.");
|
||||
|
||||
cmd.StdErr.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenValidPackageIsPassedAfterVersionItGetsAdded()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue