Exemplo n.º 1
0
        public void CommitFinder_FindCommitOnBranchToIgnore_SmokeTest()
        {
            var commitInfo = CommitFinder.FindCommitsOnBranchToIgnore(TestDataLocator.GetPath(), "release", new SearchOptions());

            Assert.AreEqual("3e8a6ddbef973d021ed13a48a9af2c306beef558", commitInfo.Item2);
            Assert.AreEqual(1, commitInfo.Item1.Count());
            Assert.AreEqual("7dfe9984e660d26829bbcbd29648348de9623221", commitInfo.Item1.First().Hash);
        }
        public void GetDataFolder_WhenGivenRepoPath_ReturnsDataFolderPath()
        {
            string path = TestDataLocator.GetMinecraftDataPath();

            string resultPath = DataFolderHelper.GetDataFolder(path);

            Assert.Equal("data", resultPath.Split(Path.DirectorySeparatorChar).Last());
        }
        public void GetDataFolder_WhenGivenDataFolderPath_ReturnsDataFolderPath()
        {
            string path = Path.Combine(TestDataLocator.GetMinecraftDataPath(), "data");

            string resultPath = DataFolderHelper.GetDataFolder(path);

            Assert.Equal(path, resultPath);
        }
        public async Task GetVersionsForPlatformAsync_GivenPcPlatform_ReturnsVersions()
        {
            var sut = new MinecraftDataReader(TestDataLocator.GetMinecraftDataPath());

            var result = (await sut.GetVersionsForPlatformAsync(MinecraftPlatform.Pc)).ToList();

            Assert.NotEmpty(result);
            Assert.Contains(new MinecraftVersion("1.11.2"), result);
        }
Exemplo n.º 5
0
        public void CommitFinder_EndingOnlyRange_ReturnsCorrectEntires()
        {
            var range = new SearchRange();

            range.Newest = "261dab6".Some();
            var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range);

            Assert.AreEqual(20, commits.Count());
        }
Exemplo n.º 6
0
        public void CommitFinder_ParseInvalidBranch_ReturnsEmpty()
        {
            var commits = CommitFinder.Parse(TestDataLocator.GetPath(), new SearchRange()
            {
                Oldest = "a-non-existant-branch".Some()
            });

            Assert.Zero(commits.Count());
        }
Exemplo n.º 7
0
        void TestCommitHasNoBug(string hash, Option <SearchOptions> options)
        {
            var commit = CommitFinder.ParseSingle(TestDataLocator.GetPath(), hash);

            Assert.True(commit.HasValue);
            commit.MatchSome(c => {
                var parsedCommits = CommitParser.ParseSingle(c, options.ValueOr(new SearchOptions()));
                Assert.Zero(parsedCommits.Count());
            });
        }
Exemplo n.º 8
0
        public void CommitParser_SmokeTestAllCommits()
        {
            var commits       = CommitFinder.Parse(TestDataLocator.GetPath(), new SearchRange());
            var parsedCommits = CommitParser.Parse(commits, new SearchOptions());

            Assert.NotZero(commits.Count());
            foreach (var parsedCommit in parsedCommits)
            {
                Assert.IsNotNull(parsedCommit.Commit.Title);
                Assert.IsNotNull(parsedCommit.Link);
            }
        }
Exemplo n.º 9
0
        void TestMultipleCommits(string hash, List <string> expectedUrls, Option <SearchOptions> options)
        {
            var commit = CommitFinder.ParseSingle(TestDataLocator.GetPath(), hash);

            Assert.IsTrue(commit.HasValue);
            commit.MatchSome(c =>
            {
                var parsedCommits = CommitParser.ParseSingle(c, options.ValueOr(new SearchOptions())).ToList();
                Assert.AreEqual(parsedCommits.Count(), expectedUrls.Count);
                Assert.True(new HashSet <string> (parsedCommits.Select(x => x.Link)).SetEquals(expectedUrls));
            });
        }
Exemplo n.º 10
0
        public void CommitFinder_Parse_ReturnsEntries()
        {
            var commits = CommitFinder.Parse(TestDataLocator.GetPath(), new SearchRange());
            int count   = commits.Count();

            Assert.NotZero(commits.Count());
            foreach (var commit in commits)
            {
                Assert.IsNotNull(commit.Hash);
                Assert.IsNotNull(commit.Title);
                Assert.IsNotNull(commit.Description);
            }
        }
Exemplo n.º 11
0
        public void CommitFinder_StartingOnlyRange_ReturnsCorrectEntires()
        {
            // This is brittle if we add more tests data
            var range = new SearchRange();

            range.Oldest = "261dab6".Some();
            var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range);

            Assert.AreEqual(27, commits.Count());

            range.IncludeOldest = false;
            commits             = CommitFinder.Parse(TestDataLocator.GetPath(), range);
            Assert.AreEqual(26, commits.Count());
        }
Exemplo n.º 12
0
        public void CommitFinder_SubsetRange_ReturnsCorrectEntires()
        {
            var range = new SearchRange();

            range.Oldest = "4bb85fb".Some();
            range.Newest = "261dab6".Some();
            var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range);

            Assert.AreEqual(6, commits.Count());

            range.IncludeOldest = false;
            commits             = CommitFinder.Parse(TestDataLocator.GetPath(), range);
            Assert.AreEqual(5, commits.Count());
        }
Exemplo n.º 13
0
        public void BugCollector_SmokeTest()
        {
            var options = new SearchOptions()
            {
                Bugzilla = BugzillaLevel.Private
            };
            var range = new SearchRange {
                Oldest = "98fff31".Some(), Newest = "6c280ad".Some()
            };
            var commits       = CommitFinder.Parse(TestDataLocator.GetPath(), range);
            var parsedCommits = CommitParser.Parse(commits, options).ToList();

            var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options);

            Assert.AreEqual(2, bugCollection.Bugs.Count);
            Assert.AreEqual(3, bugCollection.PotentialBugs.Count);
        }
Exemplo n.º 14
0
        public void BugCollector_HandlesDuplicateBugEntries()
        {
            // One commit with certain, one without. Only one copy in final output
            var options = new SearchOptions()
            {
                Bugzilla = BugzillaLevel.Private
            };
            var range = new SearchRange {
                Oldest = "ad26139".Some(), Newest = "6c280ad".Some()
            };
            var commits       = CommitFinder.Parse(TestDataLocator.GetPath(), range);
            var parsedCommits = CommitParser.Parse(commits, options).ToList();

            var bugCollection = BugCollector.ClassifyCommits(parsedCommits, new SearchOptions());

            Assert.AreEqual(1, bugCollection.Bugs.Count);
            Assert.AreEqual(0, bugCollection.PotentialBugs.Count);
        }
Exemplo n.º 15
0
        void TestConfidenceOfCommit(string hash, string expectedUrl, ParsingConfidence expectedConfidence, Option <SearchOptions> options)
        {
            var commit = CommitFinder.ParseSingle(TestDataLocator.GetPath(), hash);

            Assert.IsTrue(commit.HasValue);
            commit.MatchSome(c =>
            {
                var parsedCommits = CommitParser.ParseSingle(c, options.ValueOr(new SearchOptions()
                {
                    Bugzilla = BugzillaLevel.Private
                }));

                Assert.AreEqual(1, parsedCommits.Count(), $"{hash} did not parse into one bug commit");
                var parsedCommit = parsedCommits.First();

                Assert.AreEqual(expectedUrl, parsedCommit.Link, $"{hash} link {parsedCommit.Link} did not match expected {expectedUrl}");
                Assert.AreEqual(expectedConfidence, parsedCommit.Confidence, $"{hash} confidence {parsedCommit.Confidence} did not match expected {expectedConfidence}");
            });
        }
Exemplo n.º 16
0
        public static string GetGeometryTestDataPath(string fileName)
        {
            var locator = TestDataLocator.Create("ProSuite", @"TestData\Geometry");

            return(locator.GetPath(fileName));
        }
Exemplo n.º 17
0
        public static string GetCartoMapImplTestMapPath()
        {
            var locator = new TestDataLocator();

            return(locator.GetPath(_cartoMapImplTestMapName));
        }
Exemplo n.º 18
0
        public static string GetGdbTableJointUtilsPath()
        {
            var locator = new TestDataLocator();

            return(locator.GetPath(_filegdb_tableJoinUtils));
        }
Exemplo n.º 19
0
        public static string GetGdb2Path()
        {
            var locator = new TestDataLocator();

            return(locator.GetPath(_gdb2Name));
        }
Exemplo n.º 20
0
        public static string GetFileGdb93Path()
        {
            var locator = new TestDataLocator();

            return(locator.GetPath(_filegdb93Name));
        }
Exemplo n.º 21
0
        public void CommitFinder_ParseInvalidHash_ReturnsEmpty()
        {
            var commit = CommitFinder.ParseSingle(TestDataLocator.GetPath(), "NOT_A_HASH");

            Assert.IsFalse(commit.HasValue);
        }
Exemplo n.º 22
0
        private static string GetWorkspaceCatalogPath()
        {
            var locator = TestDataLocator.Create("ProSuite", @"QA\TestData");

            return(locator.GetPath("QATestData.mdb"));
        }
        public void GetDataFolder_WhenGivenInvalidPath_ThrowsException()
        {
            string path = Path.GetDirectoryName(TestDataLocator.GetMinecraftDataPath());

            Assert.Throws <InvalidDataPathException>(() => DataFolderHelper.GetDataFolder(path));
        }
Exemplo n.º 24
0
        public void CanFindTestData()
        {
            var path = new TestDataLocator().GetPath("IssuePolygons.xml");

            Assert.True(System.IO.File.Exists(path));
        }
        private static async Task <VersionDefinition> GetDefinitionsForVersion()
        {
            var sut = new MinecraftDataReader(TestDataLocator.GetMinecraftDataPath());

            return(await sut.GetDefinitionForVersionAsnyc(MinecraftPlatform.Pc, new MinecraftVersion("1.9.2")));
        }
Exemplo n.º 26
0
        public void CommitFinder_ParseSingle_ReturnsEntry()
        {
            var commit = CommitFinder.ParseSingle(TestDataLocator.GetPath(), "98fff3172956031c4443574d0f6c9d1e204893ae");

            Assert.IsTrue(commit.HasValue);
        }
Exemplo n.º 27
0
        public static string GetNonGdbAccessDatabase()
        {
            var locator = new TestDataLocator();

            return(locator.GetPath("access_db.mdb"));
        }
Exemplo n.º 28
0
        public static string GetTiffDtm()
        {
            var locator = new TestDataLocator();

            return(locator.GetPath("test_dtm.tif"));
        }
Exemplo n.º 29
0
        public static TestDataLocator GetTestDataLocator()
        {
            var locator = TestDataLocator.Create("ProSuite");

            return(locator);
        }
Exemplo n.º 30
0
        public void CommitFinder_FindMergeBase_SmokeTest()
        {
            var mergeBase = CommitFinder.FindMergeBase(TestDataLocator.GetPath(), "release");

            Assert.AreEqual("3e8a6ddbef973d021ed13a48a9af2c306beef558", mergeBase.ValueOrFailure());
        }