V15: Adding tests for INavigationQueryService.TryGetLevel() (#17375)
* Fixing implementation to return null as level when it cannot retrieve it * Adding unit tests
This commit is contained in:
committed by
GitHub
parent
64b6c8a47e
commit
853e605665
@@ -64,12 +64,13 @@ internal abstract class ContentNavigationServiceBase
|
||||
public bool TryGetSiblingsKeysInBin(Guid key, out IEnumerable<Guid> siblingsKeys)
|
||||
=> TryGetSiblingsKeysFromStructure(_recycleBinNavigationStructure, key, out siblingsKeys);
|
||||
|
||||
public bool TryGetLevel(Guid contentKey, out int level)
|
||||
public bool TryGetLevel(Guid contentKey, out int? level)
|
||||
{
|
||||
level = 1;
|
||||
Guid? parentKey;
|
||||
if (TryGetParentKey(contentKey, out parentKey) is false)
|
||||
{
|
||||
level = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,6 +78,7 @@ internal abstract class ContentNavigationServiceBase
|
||||
{
|
||||
if (TryGetParentKey(parentKey.Value, out parentKey) is false)
|
||||
{
|
||||
level = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user