Exemplo n.º 1
0
        public void Collections_Add()
        {
            ReadCollection.AssertEmpty();

            var item = CreateItem1();

            WriteCollection.Add(item);

            ReadCollection.AssertContainsOnly(item);

            WriteCollection.Add(item);

            if (AllowDuplicateEntries)
            {
                ReadCollection.AssertSequence(item, item);
            }
            else
            {
                ReadCollection.AssertContainsOnly(item);
            }

            WriteCollection.Remove(item);

            if (AllowDuplicateEntries)
            {
                ReadCollection.AssertContainsOnly(item);
            }
            else
            {
                ReadCollection.AssertEmpty();
            }
        }
Exemplo n.º 2
0
        public void Collections_Clear()
        {
            var item1 = CreateItem1();
            var item2 = CreateItem2();

            WriteCollection.Add(item1);
            WriteCollection.Add(item2);

            WriteCollection.Clear();

            ReadCollection.AssertEmpty();
        }