dotnet-installer/test/core-sdk-tasks.Tests/CalculateTemplateVerionsTests.cs
William Li 0806ef1bd1 Use Task to calculate template versions
No behaivor change
2020-01-25 16:40:47 -08:00

27 lines
989 B
C#

using FluentAssertions;
using Xunit;
using Microsoft.DotNet.Cli.Build;
namespace EndToEnd
{
public class CalculateTemplateVerionsTests
{
[Fact]
public void ItCanCalculateTemplateVersionsInStableBuilds()
{
var result = CalculateTemplateVersions.Calculate("3.1.0", "014885", "dev");
result.BundledTemplateInstallPath.Should().Be("3.1.0");
result.BundledTemplateMsiVersion.Should().Be("3.1.0.014885");
result.BundledTemplateMajorMinorVersion.Should().Be("3.1");
}
[Fact]
public void ItCanCalculateTemplateVersionsInNonStableBuilds()
{
var result = CalculateTemplateVersions.Calculate("5.0.0-alpha.1.20071.6", "014885", "dev");
result.BundledTemplateInstallPath.Should().Be("5.0.0-dev");
result.BundledTemplateMsiVersion.Should().Be("5.0.0.014885");
result.BundledTemplateMajorMinorVersion.Should().Be("5.0");
}
}
}