public void Checker_DoesNotWarn_WhenCurrentVersionUsed() { // Arrange var checker = new NodeVersionChecker(NullLogger <NodeVersionChecker> .Instance); // Act var messages = checker.CheckToolVersions( new Dictionary <string, string> { { NodeConstants.NodeToolName, NodeVersions.Node10Version } }); // Assert Assert.Empty(messages); }
public void Checker_DoesNotWarn_WhenCurrentVersionUsed() { // Arrange var checker = new NodeVersionChecker(); // Act var messages = checker.CheckToolVersions( new Dictionary <string, string> { { NodeConstants.NodeJsName, "10.15.3" } }); // Assert Assert.Empty(messages); }
public void Checker_DoesNotWarn_WhenLtsVersionUsed() { // Arrange var checker = new NodeVersionChecker(NullLogger <NodeVersionChecker> .Instance); // Act var ltsVer = NodeScriptGeneratorOptionsSetup.NodeLtsVersion; var messages = checker.CheckToolVersions( new Dictionary <string, string> { { NodeConstants.NodeToolName, ltsVer } }); // Assert Assert.Empty(messages); }
public void Checker_Warns_WhenOutdatedVersionUsed() { // Arrange var checker = new NodeVersionChecker(NullLogger <NodeVersionChecker> .Instance); // Act var messages = checker.CheckToolVersions( new Dictionary <string, string> { { NodeConstants.NodeToolName, "1.0.0" } }); // Assert Assert.Single(messages); Assert.Contains("outdated version of Node.js was detected", messages.First().Content); }