public void Throw_if_some_item_in_collection_is_null()
            {
                var set = new InternalSetForTests();

                Assert.Equal(
                    new ArgumentNullException("entity").Message,
                    Assert.Throws <ArgumentNullException>(() => set.RemoveRange(new[] { null, new FakeEntity() })).Message);
            }
            public void With_wrong_type_throws()
            {
                var set = new InternalSetForTests();

                Assert.Equal(
                    Strings.DbSet_BadTypeForAddAttachRemove("RemoveRange", "String", "FakeEntity"),
                    Assert.Throws <ArgumentException>(() => set.RemoveRange(new[] { "Bang!" })).Message);
            }
            public void Call_to_detect_changes_only_once()
            {
                var objectContextMock = Mock.Get(MockHelper.CreateMockObjectContext <FakeEntity>());

                objectContextMock.Setup(s => s.DeleteObject(It.IsAny <FakeEntity>()));

                var internalContext = new Mock <InternalContextForMock>();

                internalContext.Setup(c => c.ObjectContext)
                .Returns(objectContextMock.Object);

                var set = new InternalSetForTests(internalContext.Object);

                set.RemoveRange(new[] { new FakeEntity(), new FakeEntity() });

                internalContext.Verify(c => c.DetectChanges(It.Is <bool>(b => b == false)), Times.Once());
            }