public void TestBasic()
 {
     DummySingleObservableCollection<int> dscc = new DummySingleObservableCollection<int>(23);
     dscc.ShoulBeACoherentList();
     dscc.ShouldBeReadOnlyCollection_Generic();
     dscc.Should().Equal(23);
 }
        public void Test_Exceptions()
        {
            DummySingleObservableCollection<int> dscc = new DummySingleObservableCollection<int>(23);
            dscc.ShoulBeACoherentList();

            dscc.MonitorEvents();

            int res = 0;
            Action ac = () => res = dscc[1];
            ac.ShouldThrow<ArgumentOutOfRangeException>();

            dscc.ShouldNotRaise("CollectionChanged");
            dscc.ShouldNotRaise("PropertyChanged");
        }
        public void Test_Exceptions_GetEnumerator()
        {
            DummySingleObservableCollection<int> dscc = new DummySingleObservableCollection<int>(23);
            dscc.ShoulBeACoherentList();

            IEnumerator<int> ie = dscc.GetEnumerator();
            ie.MoveNext().Should().BeTrue();
            ie.Current.Should().Be(23);
            ie.MoveNext().Should().BeFalse();

            int res = 0;
            Action ac = () => res = ie.Current;
            ac.ShouldThrow<InvalidOperationException>();

            ie.Reset();
            ie.MoveNext().Should().BeTrue();
            ie.Current.Should().Be(23);
        }