int[] numbers = { 1, 1, 1, 1 }; Assert.IsTrue(numbers.AreAllEqual()); //True
string[] names = { "John", "John", "Smith" }; Assert.IsFalse(names.AreAllEqual()); //FalseIn this example, we have an array of strings with two "John" and one "Smith" values. The AreAllEqual method will return false because not all the values are equal. The Assert AreAllEqual method is a part of the NUnit testing framework, which is a unit-testing package library for .NET applications.