Ejemplo n.º 1
0
        public void UsingAddRangeAddsValues()
        {
            var collection1 = new StubCollection(new List <int> {
                1, 2, 3
            });
            var collection2 = new StubCollection();

            collection2.AddRange(collection1);
            collection2.Count.Should().Be(3);
        }
Ejemplo n.º 2
0
        public void AddRangeThrowsWhenCollectionIsNull()
        {
            Action act = () =>
            {
                var collection = new StubCollection();
                collection.AddRange(null);
            };

            act.ShouldThrow <ArgumentNullException>().Where(x => x.Message.Contains("Parameter collection is null"));
        }