public void GetNetSdkCoreVersion_NotUsingNewestVersion() { //Arrange var handler = new NetCoreSdkVersionChecker(_processManagerMock); _processManagerMock.AddExpectation("dotnet", "--version", "3.1.202\r\n"); //Act var result = handler.GetVersion(new InputParameters(false, false)).ToArray(); //Assert Assert.IsTrue(result.Length == 2); Assert.IsTrue(result.Any(x => x.Version == "3.1.202 *In use")); }
public void GetNetCoreSdkVersion_Verbose() { //Arrange var handler = new NetCoreSdkVersionChecker(_processManagerMock); _processManagerMock.AddExpectation("dotnet", "--version", "3.1.401\r\n"); //Act var result = handler.GetVersion(new InputParameters(true, false)).ToArray(); //Assert // Assert.IsTrue(result.Any(x => x.Version == "3.1.401 *In use")); Assert.IsTrue(result.Length == 4); Assert.IsTrue(result.Any(x => x.Version.Contains("3.1.401 *In use"))); }