Skip to content

CollectionAssert.AllItemsAreUnique() very slow #2494

Closed
@rvhuang

Description

@rvhuang

Consider following simple test case:

// using NUnit.Framework;
        [TestCase(10000)]
        public void TestMethod1(int range)
        {
            CollectionAssert.AllItemsAreUnique(Enumerable.Range(0, range).ToArray());
        }

it takes about 14 seconds to complete.

However, applying MS Test Framework to same test case, it takes about 12 ms only to finish.

// using Microsoft.VisualStudio.TestTools.UnitTesting;
        [TestMethod]
        public void TestMethod1()
        {
            CollectionAssert.AllItemsAreUnique(Enumerable.Range(0, 10000).ToArray());
        }

The gap between two should not be that huge.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions