Ejemplo n.º 1
0
        public void LinkSourceCsprojProject()
        {
            // Arrange
            var dllPath = Path.Combine(LinkCommandRunner.BasePath, @"Package.Csproj\1.0.0\lib\net472\Package.Csproj.dll");

            var csprojPath = Path.Combine(Constants.TestSoltuionSrc, @"Package.Csproj\Package.Csproj.csproj");
            var console    = new NuGet.CommandLine.Console();
            var packArgs   = new LinkArgs
            {
                CurrentDirectory = Path.GetDirectoryName(csprojPath),
                Console          = console,
            };
            var runner = new LinkCommandRunner(packArgs);

            // Act
            runner.Link();

            // Assert
            FileAssert.Exists(dllPath);
        }
Ejemplo n.º 2
0
        public void LinkTargetCsprojProject()
        {
            // Arrange
            var targetDirectory = Path.Combine(Constants.TestSoltuionSrc, "Console.PackageConfig");
            var dllPath         = Path.Combine(targetDirectory, @"bin\Debug\Package.Csproj.dll");

            var console  = new NuGet.CommandLine.Console();
            var linkArgs = new LinkArgs
            {
                PackageId        = "Package.Csproj",
                CurrentDirectory = targetDirectory,
                Console          = console,
            };
            var runner = new LinkCommandRunner(linkArgs);

            // Act
            runner.Link();

            // Assert
            FileAssert.Exists(dllPath);
        }
Ejemplo n.º 3
0
        public void UnlinkSourceSdkProject()
        {
            // Arrange
            var dllPath = Path.Combine(Constants.TestBasePath, @"Package.Sdk\1.0.0\lib\netstandard2.0\Package.Sdk.dll");

            Directory.CreateDirectory(Path.GetDirectoryName(dllPath));
            File.WriteAllText(dllPath, "");
            var csprojPath = Path.Combine(Constants.TestSoltuionSrc, @"Package.Sdk\Package.Sdk.csproj");
            var console    = new NuGet.CommandLine.Console();
            var linkArgs   = new UnlinkArgs
            {
                CurrentDirectory = Path.GetDirectoryName(csprojPath),
                Console          = console,
            };
            var runner = new UnlinkCommandRunner(linkArgs);

            // Act
            runner.Unlink();

            // Assert
            DirectoryAssert.DoesNotExist(Path.Combine(Constants.TestBasePath, LinkCommandRunner.BasePath, @"Package.Sdk\1.0.0"));
        }