Example #1
0
        public void GetPackageFilePathUsesOutputFileWhenPathIsRooted()
        {
            // Arrange
            var projectPath = @"X:\projects\my-project\";
            var outputFile  = @"X:\outputs\mypk.out";
            var id          = "id";
            var version     = new Version("1.1");

            // Act
            var packagePath = NewPackageCommand.GetPackageFilePath(outputFile, projectPath, id, version);

            // Assert
            Assert.AreEqual(packagePath, outputFile);
        }
Example #2
0
        public void GetPackageFilePathUsesIdAndVersionWhenOutputFileIsNull()
        {
            // Arrange
            var    projectPath = @"X:\projects\my-project\";
            string outputFile  = null;
            var    id          = "id";
            var    version     = new Version("1.1");

            // Act
            var packagePath = NewPackageCommand.GetPackageFilePath(outputFile, projectPath, id, version);

            // Assert
            Assert.AreEqual(packagePath, Path.Combine(projectPath, id + "." + version + ".nupkg"));
        }
Example #3
0
        public void GetPackageFilePathAppendsProjectPathWhenPathIsNotRooted()
        {
            // Arrange
            var projectPath = @"X:\projects\my-project\";
            var outputFile  = "mypk.out";
            var id          = "id";
            var version     = new Version("1.1");

            // Act
            var packagePath = NewPackageCommand.GetPackageFilePath(outputFile, projectPath, id, version);

            // Assert
            Assert.AreEqual(packagePath, Path.Combine(projectPath, outputFile));
        }