-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathInstallDotNetCoreTests.cs
More file actions
37 lines (33 loc) · 1.23 KB
/
InstallDotNetCoreTests.cs
File metadata and controls
37 lines (33 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Reflection;
using Xunit;
namespace Microsoft.DotNet.Arcade.Sdk.Tests
{
public class InstallDotNetCoreTests
{
[Theory]
[InlineData("8.0", true)]
[InlineData("10.0", true)]
[InlineData("3.1", true)]
[InlineData("8.0.22", false)]
[InlineData("10.0.1", false)]
[InlineData("8.0.0-preview.1", false)]
[InlineData("", false)]
[InlineData(null, false)]
[InlineData("8", false)]
[InlineData("8.0.1.2", false)]
[InlineData("v8.0", false)]
[InlineData("8.x", false)]
public void IsTwoPartVersion_DetectsCorrectFormat(string versionString, bool expected)
{
// Use reflection to call the private method
var task = new InstallDotNetCore();
var method = typeof(InstallDotNetCore).GetMethod("IsTwoPartVersion", BindingFlags.NonPublic | BindingFlags.Instance);
var result = (bool)method.Invoke(task, new object[] { versionString });
Assert.Equal(expected, result);
}
}
}