Channel9Downloader.Test.Integration.AvailableCategoriesTest.AllElementsHaveDistinctRelativePaths C# (CSharp) Method

AllElementsHaveDistinctRelativePaths() private static method

Checks whether all elements have distinct relative paths.
private static AllElementsHaveDistinctRelativePaths ( IEnumerable categories ) : bool
categories IEnumerable The categories to check.
return bool
        private static bool AllElementsHaveDistinctRelativePaths(IEnumerable<Category> categories)
        {
            foreach (var item in categories)
            {
                foreach (var compareItem in categories)
                {
                    if (compareItem == item)
                    {
                        continue;
                    }

                    if (compareItem.RelativePath == item.RelativePath)
                    {
                        return false;
                    }
                }
            }

            return true;
        }