minor bugfix
This commit is contained in:
parent
9560dc68a5
commit
42b2cb5660
@ -31,7 +31,7 @@ namespace Benchmark
|
|||||||
private static bool TryGetPrefix(in string identity, ref int lastPosition, out string prefix)
|
private static bool TryGetPrefix(in string identity, ref int lastPosition, out string prefix)
|
||||||
{
|
{
|
||||||
prefix = identity.Remove(lastPosition + 1);
|
prefix = identity.Remove(lastPosition + 1);
|
||||||
if (prefix.Length <= 3) return false;
|
if (prefix.Length < 3) return false;
|
||||||
return !prefix.Any(character => character < 'A' || character > 'Z');
|
return !prefix.Any(character => character < 'A' || character > 'Z');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ namespace TestProject1
|
|||||||
[Test]
|
[Test]
|
||||||
public void Test9()
|
public void Test9()
|
||||||
{
|
{
|
||||||
Assert.IsTrue(Identity.TryParse("WPR0001023-12", out var actual));
|
Assert.IsTrue(Identity.TryParse("WPR1000023-12", out var actual));
|
||||||
Assert.AreEqual("WPR", actual.Prefix);
|
Assert.AreEqual("WPR", actual.Prefix);
|
||||||
Assert.AreEqual(1023, actual.Index);
|
Assert.AreEqual(1000023, actual.Index);
|
||||||
Assert.AreEqual(12, actual.Revision);
|
Assert.AreEqual(12, actual.Revision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user