Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetDescendant for a simple range fails with a HierarchyIdException #46

Closed
AndyBates6668 opened this issue Sep 24, 2020 · 2 comments
Closed
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@AndyBates6668
Copy link

The following unit test fails with the current code:

    [TestMethod]
    public void InsertTopLevelNodeBetweenNodes()
    {
        var id = SqlHierarchyId.GetRoot();
        var idChild = id.GetDescendant(SqlHierarchyId.Parse("/0/"), SqlHierarchyId.Parse("/1/"));
        Assert.AreEqual("/0.1/", idChild.ToString());
    }
@dotMorten dotMorten added bug Something isn't working help wanted Extra attention is needed labels Sep 24, 2020
@AndyBates6668
Copy link
Author

I'll see what I can do to resolve the issue.

@ppasieka
Copy link
Contributor

@AndyBates6668 I have a fix for this issue. Tomorrow I will try to create a PR

ppasieka pushed a commit to ppasieka/Microsoft.SqlServer.Types that referenced this issue Sep 26, 2020
ppasieka pushed a commit to ppasieka/Microsoft.SqlServer.Types that referenced this issue Sep 27, 2020
ppasieka pushed a commit to ppasieka/Microsoft.SqlServer.Types that referenced this issue Sep 27, 2020
dotMorten pushed a commit that referenced this issue Dec 11, 2020
* #46 fix GetDescendant method on HierarchyId type

* #46 Add negative tests for GetDescendants

* #46 Use ExpectedExceptions attribute

* Fix formatting of the TestMethod attribute

* Replace ArgumentException with HierarchyIdException (fixes #48)

Co-authored-by: Piotr Pasieka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants