public void ParseGlobalJson() { var textWriter = new ConsoleTextWriter(); var tool = new GlobalJsonFileLocator(textWriter); var parseResult = tool.Parse(); (parseResult?.GlobalJsonFile.Sdk?.Version ?? throw new ArgumentNullException()).ShouldBe("2.2.100"); }
public void NotifyUserGlobalJsonNotFound() { using var sw = new StringWriter(); Console.SetOut(sw); var tool = new GlobalJsonFileLocator(new ConsoleTextWriter()); var result = tool.Parse("not-found.json"); result.IsSuccess.ShouldBe(false); result.GlobalJsonFile.ShouldBe(null); result.ErrorMessage.ShouldBe("A not-found.json file could not be found."); }