コード例 #1
0
        public void ExcludeAll()
        {
            // Add all
            IncludeAll();

            // Remove all
            _manyProperties.ExcludeAll(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);

            // Should now be empty
            Assert.IsTrue(this.SetIsEmpty());
        }
コード例 #2
0
        public void ExcludeAll()
        {
            // Add all properties
            IncludeAll();

            // Remove all int properties
            _intsAndString.ExcludeAll();

            // Should now be empty
            Assert.IsFalse(_intsAndString.Names.Any(),
                           "Expected collection to be empty");
        }
コード例 #3
0
        public void Throws_Collection_Remove_If_Bool_Set()
        {
            try
            {
                _intsAndString.ExcludeAll <float>(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, true);
            }
            catch (NoSuchPropertyException)
            {
                return;
            }

            Assert.Fail("Expected an exception to be thrown");
        }
コード例 #4
0
        public void Collection_Remove_Ignored()
        {
            // Properties exist, but not in current set
            _intsAndString.ExcludeAll <int>();

            // Nothing should happen
            Assert.AreEqual(_intsAndString.Names.Count(), 0,
                            "Expected the set to be empty");
        }