public void Should_be_possible_to_execute_UNION_operation_on_two_sets_of_referenceTypes_with_null_reference_types() { IEnumerable<string> firstReferences = new List<string>() { "10", "20" }; IEnumerable<string> secondReferences = new List<string>(); SetOperation operation = new UnionSetOperation(); IEnumerable<string> results = operation.Execute(firstReferences, secondReferences); Assert.AreEqual(2, results.Count(), "the quantity of elements is no expected"); }
public void Should_be_possible_to_execute_UNION_operation_on_two_sets_of_referenceTypes_eliminating_duplicate_elements() { IEnumerable<string> firstReferences = new List<string>() { "10", "20" }; IEnumerable<string> secondReferences = new List<string>() { "50", "20" }; SetOperation operation = new UnionSetOperation(); IEnumerable<string> results = operation.Execute(firstReferences, secondReferences); Assert.AreEqual(3, results.Count(), "the quantity of elements is no expected"); string element = results.Where<string>(item => item == "10").SingleOrDefault(); Assert.IsNotNull(element, "the element expected is not exits"); element = results.Where<string>(item => item == "20").SingleOrDefault(); Assert.IsNotNull(element, "the element expected is not exits"); element = results.Where<string>(item => item == "50").SingleOrDefault(); Assert.IsNotNull(element, "the element expected is not exits"); }