public void Test03_NoCondition() { StringCollection collection = new StringCollection(); collection.Add("Buzz"); collection.Add("Light"); collection.Add("Year"); Assert.AreEqual("Buzz", collection.First()); }
public void Test04_WithConditionNotMatched() { StringCollection collection = new StringCollection(); collection.Add("Despicable"); collection.Add("Me"); collection.Add("Minion"); collection.Add("BANANA"); Assert.ThrowsException <InvalidOperationException>(() => collection.First(s => s.StartsWith("Ba"))); }
public void Test04_WithCondition() { StringCollection collection = new StringCollection(); collection.Add("Buzz"); collection.Add("Light"); collection.Add("Year"); collection.Add("Is"); collection.Add("Yearning"); Assert.AreEqual("Year", collection.First(s => s.StartsWith("Y"))); }
public void Test02_EmptyCollection() { StringCollection collection = new StringCollection(); Assert.ThrowsException <InvalidOperationException>(() => collection.First()); }
public void Test01_NullReference() { StringCollection collection = default; Assert.ThrowsException <ArgumentNullException>(() => collection.First()); }