public void GetVersionPatternTests_WhenFullPathProvidedShouldFindVersionPattern()
        {
            var getVersionPattern = new GetVersionPattern();

            var versionPattern = getVersionPattern.ExtractVersion(Path.Combine(TestContext.DeploymentDirectory, "PackageVersionSeedFile.xml"), "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);

            Assert.AreEqual("7.6.5.4", versionPattern);
        }
Esempio n. 2
0
        public void GetVersionPatternTests_WhenFullPathProvidedShouldFindVersionPattern()
        {
            var getVersionPattern = new GetVersionPattern();

            var versionPattern = getVersionPattern.ExtractVersion(Path.Combine(TestContext.DeploymentDirectory, "PackageVersionSeedFile.xml"), "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);

            Assert.AreEqual("7.6.5.4", versionPattern);
        }
Esempio n. 3
0
        public void GetVersionPatternTests_WhenPatternProvidedShouldReturnSamePattern()
        {
            var patternToTest  = TestContext.DataRow["VersionPattern"].ToString();
            var expectedResult = bool.Parse(TestContext.DataRow["ExpectedResult"].ToString());

            var getVersionPattern = new GetVersionPattern();

            var versionPattern = getVersionPattern.ExtractVersion(patternToTest, "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);

            Assert.AreEqual(expectedResult ? patternToTest : string.Empty, versionPattern);
        }
        public void GetVersionPatternTests_WhenPatternProvidedShouldReturnSamePattern()
        {
            var patternToTest = TestContext.DataRow["VersionPattern"].ToString();
            var expectedResult = bool.Parse(TestContext.DataRow["ExpectedResult"].ToString());

            var getVersionPattern = new GetVersionPattern();

            var versionPattern = getVersionPattern.ExtractVersion(patternToTest, "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);

            Assert.AreEqual(expectedResult ? patternToTest : string.Empty, versionPattern);
        }
Esempio n. 5
0
        public void GetVersionPatternTests_WhenRelativePathProvidedShouldFindVersionPattern()
        {
            var getVersionPattern = new GetVersionPattern();

            var newPath = Path.Combine(TestContext.DeploymentDirectory, "RelativePath");
            var newFile = Path.Combine(newPath, "PackageVersionSeedFile.xml");

            Directory.CreateDirectory(newPath);
            File.Copy("PackageVersionSeedFile.xml", newFile);

            var versionPattern = getVersionPattern.ExtractVersion("RelativePath\\PackageVersionSeedFile.xml", "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);

            Assert.AreEqual("7.6.5.4", versionPattern);
        }
Esempio n. 6
0
        public void GetVersionPatternTests_WhenPassingNullSourcesDirectoryShouldThrowException()
        {
            var getVersionPattern = new GetVersionPattern();

            getVersionPattern.ExtractVersion("2.3.4.5", "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, null);
        }
Esempio n. 7
0
        public void GetVersionPatternTests_WhenPassingNullPackageIdPathShouldThrowException()
        {
            var getVersionPattern = new GetVersionPattern();

            getVersionPattern.ExtractVersion("1.2.3.4", null, GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);
        }
Esempio n. 8
0
        public void GetVersionPatternTests_WhenPassingNullVersionPatternOrSeedFilePathShouldThrowException()
        {
            var getVersionPattern = new GetVersionPattern();

            getVersionPattern.ExtractVersion(null, "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);
        }
        public void GetVersionPatternTests_WhenRelativePathProvidedShouldFindVersionPattern()
        {
            var getVersionPattern = new GetVersionPattern();

            var newPath = Path.Combine(TestContext.DeploymentDirectory, "RelativePath");
            var newFile = Path.Combine(newPath, "PackageVersionSeedFile.xml");

            Directory.CreateDirectory(newPath);
            File.Copy("PackageVersionSeedFile.xml", newFile);

            var versionPattern = getVersionPattern.ExtractVersion("RelativePath\\PackageVersionSeedFile.xml", "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);

            Assert.AreEqual("7.6.5.4", versionPattern);
        }
        public void GetVersionPatternTests_WhenPassingNullVersionPatternOrSeedFilePathShouldThrowException()
        {
            var getVersionPattern = new GetVersionPattern();

            getVersionPattern.ExtractVersion(null, "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);
        }
        public void GetVersionPatternTests_WhenPassingNullSourcesDirectoryShouldThrowException()
        {
            var getVersionPattern = new GetVersionPattern();

            getVersionPattern.ExtractVersion("2.3.4.5", "MarkNicNuGetLib", GetVersionPattern.QueryPackageId, null);
        }
        public void GetVersionPatternTests_WhenPassingNullPackageIdPathShouldThrowException()
        {
            var getVersionPattern = new GetVersionPattern();

            getVersionPattern.ExtractVersion("1.2.3.4", null, GetVersionPattern.QueryPackageId, TestContext.DeploymentDirectory);
        }