Advertisement
pszczyg

VerboseCollectionAssertTests

Jan 8th, 2024
758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. [TestFixture]
  2. internal class VerboseCollectionAssertTests
  3. {
  4.     [DebuggerDisplay("{" + nameof(Name) +"}")]
  5.     class VerboseClass
  6.     {
  7.         public string Name { get; set; }
  8.  
  9.         public override string ToString()
  10.         {
  11.             return Name;
  12.         }
  13.     }
  14.  
  15.     [Test]
  16.     public void CompareVerboseCollections()
  17.     {
  18.         var expectedCollection = new List<VerboseClass>
  19.         {
  20.             new VerboseClass{ Name = "ExpectedName1" },
  21.             new VerboseClass{ Name = "ExpectedName2" },
  22.         };
  23.  
  24.         var actualCollection = new List<VerboseClass>
  25.         {
  26.             new VerboseClass{ Name = "ActualName1" },
  27.             new VerboseClass{ Name = "ActualName2" },
  28.         };
  29.  
  30.         CollectionAssert.AreEquivalent(expectedCollection, actualCollection);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement