diff --git a/tests/Neo.UnitTests/Persistence/UT_DataCache.cs b/tests/Neo.UnitTests/Persistence/UT_DataCache.cs index 1778aa3b92..45a04aec07 100644 --- a/tests/Neo.UnitTests/Persistence/UT_DataCache.cs +++ b/tests/Neo.UnitTests/Persistence/UT_DataCache.cs @@ -182,12 +182,12 @@ public void TestFind() items = myDataCache.Find(new byte[] { }); items.Count().Should().Be(4); - // null and empty with the backwards direction -> miserably fails. - // Action action = () => myDataCache.Find(null, SeekDirection.Backward); - // action.Should().Throw(); + // null and empty with the backwards direction start from the last key + items = myDataCache.Find(null, SeekDirection.Backward); + // no exception, and results check will be added later. - // action = () => myDataCache.Find(new byte[] { }, SeekDirection.Backward); - // action.Should().Throw(); + items = myDataCache.Find(new byte[] { }, SeekDirection.Backward); + // no exception, and results check will be added later. items = myDataCache.Find(k1, SeekDirection.Backward); key1.Should().Be(items.ElementAt(0).Key); @@ -439,7 +439,7 @@ public void TestFindEmptyPrefix() items = dataCache.Find([0xff, 0xff, 0xff, 0xff, 0xff], SeekDirection.Backward).ToArray(); items.Length.Should().Be(1); items[0].Key.ToArray().Should().BeEquivalentTo(k3.ToArray()); - + items = dataCache.Find([0xff], SeekDirection.Backward).ToArray(); items.Length.Should().Be(3); items[0].Key.ToArray().Should().BeEquivalentTo(k3.ToArray());