예제 #1
0
        /// <summary>
        ///ExceptWith 的测试
        ///</summary>
        public void ExceptWithTestHelper <KeyT>()
        {
            SafeHashSet <KeyT> target = new SafeHashSet <KeyT>(); // TODO: 初始化为适当的值
            IEnumerable <KeyT> other  = null;                     // TODO: 初始化为适当的值

            target.ExceptWith(other);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
예제 #2
0
        public void SafeHashSet依照帶入參數執行差集操作_執行成功_結果應是SafeHashSet與參數的差集()
        {
            var safeHashSet = new SafeHashSet <int> {
                1, 2, 3, 4, 5
            };
            var param = Enumerable.Range(0, 10).Where(x => x % 2 == 0);

            safeHashSet.ExceptWith(param);
            var expectedResult = new List <int> {
                1, 3, 5
            };

            safeHashSet.SequenceEqual(expectedResult).Should().Be(true);
        }