public void SetUp()
        {
            _source = new List <int>(CollectionTestUtils.MakeTestList <int>(_size));

            _nonReversable = new TransformingList <int, string>(_source, _intToString);

            _reversable = new TransformingList <int, string>(_source, _intToString, _stringToInt);
        }
 [TestFixtureSetUp] public void FixtureSetup()
 {
     _source   = CollectionTestUtils.MakeTestList <TSource>(10);
     _expected = new List <TTarget>(_source.Count);
     foreach (TSource i in _source)
     {
         _expected.Add(Converter(i));
     }
 }
 public void ChokesOnConstructingWithNullTransformer()
 {
     TestHelper.AssertException <ArgumentNullException>(
         delegate
     {
         new TransformingList <int, string>(
             CollectionTestUtils.MakeTestList <int>(10), null);
     },
         MessageMatch.Contains, "transformer");
 }
 public void SetUp()
 {
     _readOnlyTestee          = new MockList <int>();
     _mutableTestee           = new MockListMutable <int>();
     _readOnlyNonGeneric      = _readOnlyTestee;
     _mutableNonGeneric       = _mutableTestee;
     _backList                = CollectionTestUtils.MakeTestList <int>(_size);
     _readOnlyTestee.TrueList = _backList;
     _mutableTestee.TrueList  = _backList;
 }
        public void Clear()
        {
            _nonReversable.Clear();
            Assert.IsEmpty(_source);

            _source.AddRange(CollectionTestUtils.MakeTestList <int>(_size));
            Assert.AreEqual(_size, _source.Count);

            _reversable.Clear();
            Assert.IsEmpty(_source);
        }
 public void GetEmuerator()
 {
     TestHelper.AssertEnumeratorEquals(
         CollectionTestUtils.MakeTestList <string>(_size).GetEnumerator(),
         _nonReversable.GetEnumerator());
 }
예제 #7
0
 public void SunnyDay()
 {
     CollectionTestUtils.VerifyData <T>(BackCollection, Testee);
     Assert.IsFalse(Testee.Contains(TheTestItem1));
 }