Esempio n. 1
0
        public void CanAddOneItemToList()
        {
            _actionSource.Add(3);

            // The "ToList()" call here converts Actions, which is an IEnumerable<int>,
            // into a List<int>, which has a Count method, and which allows you to get
            // specific elements via [0], [1], etc.  It's just a little easier to work with.
            List <int> actualList = _actionSource.Actions.ToList();

            // This line verifies that we have exactly 1 element in the list of actions.
            Assert.That(actualList.Count, Is.EqualTo(1));

            // This line verifies that the first element in the list (the element at index 0)
            // is "3", the expected value.
            Assert.That(actualList[0], Is.EqualTo(3));
        }
Esempio n. 2
0
 public void CanAddOneItemToList()
 {
     _actionSource.Add(3);
     Assert.That(_actionSource.Actions, Is.EqualTo(new[] { 3 }));
 }