Fix UdiRange.Parse() throwing ArgumentException for valid value (#16788)
* Add test to assert UdiRange can round-trip all selectors * Fix parsing UdiRange without a selector
This commit is contained in:
@@ -201,6 +201,21 @@ public class UdiTests
|
||||
Assert.Throws<ArgumentException>(() => new UdiRange(guidUdi, "x"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase(Constants.DeploySelector.This)]
|
||||
[TestCase(Constants.DeploySelector.ThisAndChildren)]
|
||||
[TestCase(Constants.DeploySelector.ThisAndDescendants)]
|
||||
[TestCase(Constants.DeploySelector.ChildrenOfThis)]
|
||||
[TestCase(Constants.DeploySelector.DescendantsOfThis)]
|
||||
[TestCase(Constants.DeploySelector.EntitiesOfType)]
|
||||
public void RangeParseTest(string selector)
|
||||
{
|
||||
var expected = new UdiRange(Udi.Create(Constants.UdiEntityType.AnyGuid, Guid.NewGuid()), selector);
|
||||
var actual = UdiRange.Parse(expected.ToString());
|
||||
|
||||
Assert.AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TryParseTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user