Esempio n. 1
0
        public void DotnetToolTests_NoPackageReferenceToolRestore_ThrowsError(string tfm)
        {
            using (var testDirectory = TestDirectory.Create())
            {
                var projectName      = "ToolRestoreProject";
                var workingDirectory = Path.Combine(testDirectory, projectName);
                var source           = workingDirectory;
                var rid      = "win-x86";
                var packages = new List <PackageIdentity>();

                _msbuildFixture.CreateDotnetToolProject(solutionRoot: testDirectory.Path,
                                                        projectName: projectName, targetFramework: tfm, rid: rid,
                                                        source: workingDirectory, packages: packages);
                // Act
                var result = _msbuildFixture.RestoreToolProject(workingDirectory, projectName, string.Empty);

                // Assert
                Assert.True(result.Item1 == 1, result.AllOutput);
                Assert.Contains("NU1211", result.Item2);
            }
        }
Esempio n. 2
0
        public void DotnetToolTests_NoPackageReferenceToolRestore_ThrowsError()
        {
            using (var testDirectory = _msbuildFixture.CreateTestDirectory())
            {
                var tfm              = "netcoreapp2.0";
                var projectName      = "ToolRestoreProject";
                var workingDirectory = Path.Combine(testDirectory, projectName);
                var rid              = "win-x86";

                _msbuildFixture.CreateDotnetToolProject(testDirectory.Path, projectName, tfm, rid);

                // Act
                var result = _msbuildFixture.RestoreToolProject(workingDirectory, projectName, string.Empty);

                // Assert
                Assert.True(result.ExitCode == 1, result.AllOutput);
                Assert.Contains("NU1211", result.Output);
            }
        }