Пример #1
0
        public void GivenSubset_ComputeComplement()
        {
            //Arrange
            var reference = new List <long> {
                1, 2, 3, 4, 5
            };
            var subset1 = new List <long> {
                1, 3, 5
            };
            var subset2 = new List <long> {
                2, 3, 7, 8
            };
            var subset3 = new List <long> {
                1, 2, 3, 4, 5
            };
            var expected1 = new List <long> {
                2, 4
            };
            var expected2 = new List <long> {
                1, 4, 5
            };
            var expected3 = new List <long>();

            //Act
            var actual1 = UtilityFunctions.Complement(subset1, reference);
            var actual2 = UtilityFunctions.Complement(subset2, reference);
            var actual3 = UtilityFunctions.Complement(subset3, reference);

            //Assert
            Assert.True(Enumerable.SequenceEqual(expected1, actual1));
            Assert.True(Enumerable.SequenceEqual(expected2, actual2));
            Assert.True(Enumerable.SequenceEqual(expected3, actual3));
        }