public void AddRandomTest() { var col = new MyNewCollection("TestCollection", 10); col.AddRandom(); Assert.AreEqual(11, col.Count); }
public void CollectionCountChangedEventTest() { var col1 = new MyNewCollection("FirstCol", 10); var journal = new Journal(); col1.CollectionCountChanged += journal.OnCollectionCountChanged; col1.Remove(5); col1.AddRandom(); col1.Add((Food) new Food().CreateRandom()); Assert.IsTrue(journal.ToString().Contains("Удаление")); Assert.IsTrue(journal.ToString().Contains("Добавление")); }