public void ShouldThrowMeaningfulExceptionWhenRuntimeTargetIsMissing() { using (var projectFolder = new DisposableFolder()) { ProcessHelper.RunAndCaptureOutput("dotnet", "new console -n SampleLibrary", projectFolder.Path); ProcessHelper.RunAndCaptureOutput("dotnet", "restore", projectFolder.Path); var pathToAssetsFile = Path.Combine(projectFolder.Path, "SampleLibrary", "obj", "project.assets.json"); var dependencyResolver = new ScriptDependencyContextReader(TestOutputHelper.CreateTestLogFactory()); var exception = Assert.Throws <InvalidOperationException>(() => dependencyResolver.ReadDependencyContext(pathToAssetsFile)); Assert.Contains("Make sure that the project file was restored using a RID (runtime identifier).", exception.Message); } }
private ScriptParser CreateParser() { return(new ScriptParser(TestOutputHelper.CreateTestLogFactory())); }
private CompilationDependencyResolver CreateCompilationDependencyResolver() { var resolver = new CompilationDependencyResolver(TestOutputHelper.CreateTestLogFactory()); return(resolver); }
static ScriptTestRunner() { // Redirect log messages to the test output window when running in process (DEBUG) Program.CreateLogFactory = (verbosity, debugMode) => TestOutputHelper.CreateTestLogFactory(); }
private RuntimeDependencyResolver CreateRuntimeDependencyResolver() { var resolver = new RuntimeDependencyResolver(TestOutputHelper.CreateTestLogFactory(), useRestoreCache: false); return(resolver); }
private LogFactory GetLogFactory() { return(TestOutputHelper.CreateTestLogFactory()); }
private ScriptProjectProvider CreateProvider() { ScriptProjectProvider provider = new ScriptProjectProvider(TestOutputHelper.CreateTestLogFactory()); return(provider); }