Пример #1
0
        public void Should_be_possible_to_define_the_object_flag_based_on_the_objects_of_set_for_the_complement_operator()
        {
            FlagEnumeration firstObjectFlag  = FlagEnumeration.incomplete;
            FlagEnumeration secondObjectFlag = FlagEnumeration.notapplicable;

            SetOperation    operation = new ComplementSetOperation();
            FlagEnumeration result    = operation.GetObjectFlag(firstObjectFlag, secondObjectFlag);

            Assert.AreEqual(FlagEnumeration.error, result, "the flag enumaration is not expected");


            firstObjectFlag  = FlagEnumeration.notcollected;
            secondObjectFlag = FlagEnumeration.notcollected;
            result           = operation.GetObjectFlag(firstObjectFlag, secondObjectFlag);
            Assert.AreEqual(FlagEnumeration.notcollected, result, "the flag enumaration is not expected");
        }
Пример #2
0
        public void Should_be_possible_to_get_a_complement_between_two_sets()
        {
            IEnumerable <string> firstReferences = new List <string>()
            {
                "10", "20", "40", "60"
            };
            IEnumerable <string> secondReferences = new List <string>()
            {
                "20", "60"
            };

            SetOperation         operation = new ComplementSetOperation();
            IEnumerable <string> results   = operation.Execute(firstReferences, secondReferences);

            Assert.AreEqual(2, results.Count());

            string element = results.Where <string>(item => item == "10").SingleOrDefault();

            Assert.IsNotNull(element, "the element expected is not exits");
            element = results.Where <string>(item => item == "40").SingleOrDefault();
            Assert.IsNotNull(element, "the element expected is not exits");
        }