Generate version file
This commit is contained in:
parent
c3e38959d8
commit
7b76c6dd89
2 changed files with 40 additions and 0 deletions
33
test/EndToEnd/VersionTests.cs
Normal file
33
test/EndToEnd/VersionTests.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using FluentAssertions;
|
||||
using Microsoft.DotNet.TestFramework;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Xunit;
|
||||
|
||||
namespace EndToEnd.Tests
|
||||
{
|
||||
public class VersionTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void DotnetVersionReturnsCorrectVersion()
|
||||
{
|
||||
var result = new DotnetCommand()
|
||||
.ExecuteWithCapturedOutput("--version");
|
||||
|
||||
result.Should().Pass();
|
||||
|
||||
var dotnetFolder = Path.GetDirectoryName(RepoDirectoriesProvider.DotnetUnderTest);
|
||||
|
||||
var sdkFolders = Directory.GetDirectories(Path.Combine(dotnetFolder, "sdk"));
|
||||
|
||||
sdkFolders.Length.Should().Be(1, "Only one SDK folder is expected in the layout");
|
||||
|
||||
var expectedSdkVersion = Path.GetFileName(sdkFolders.Single());
|
||||
|
||||
result.StdOut.Trim().Should().Be(expectedSdkVersion);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue