public void LeftJoin_can_left_join() { // Arrange LeftJoin leftJoin = new LeftJoin(); Dictionary <string, string> HT1 = new Dictionary <string, string>(); Dictionary <string, string> HT2 = new Dictionary <string, string>(); HT1.Add("fond", "enamored"); HT1.Add("wrath", "anger"); HT1.Add("diligent", "employed"); HT1.Add("outfit", "garb"); HT1.Add("guide", "usher"); HT2.Add("fond", "averse"); HT2.Add("wrath", "delight"); HT2.Add("diligent", "idle"); HT2.Add("guide", "follow"); HT2.Add("flow", "jam"); //<- Not expected to be in result // Act List <string[]> result = leftJoin.LeftJoiner(HT1, HT2); // Assert // Expected: [["fond", "enamored", "averse"], ["wrath", "anger", "delight"], ["diligent", "employed", "idle"], ["outfit", "garb", null], ["guide", "usher", "follow"] , ["flow", null, "jam"]] List <string[]> expected = new List <string[]>(); string[] expectedArray1 = new string[3] { "fond", "enamored", "averse" }; string[] expectedArray2 = new string[3] { "wrath", "anger", "delight" }; string[] expectedArray3 = new string[3] { "diligent", "employed", "idle" }; string[] expectedArray4 = new string[3] { "outfit", "garb", null }; string[] expectedArray5 = new string[3] { "guide", "usher", "follow" }; expected.Add(expectedArray1); expected.Add(expectedArray2); expected.Add(expectedArray3); expected.Add(expectedArray4); expected.Add(expectedArray5); Assert.Equal(expected, result); }
public void LeftJoin_can_left_join_single_key_value_pairs() { // Arrange LeftJoin leftJoin = new LeftJoin(); Dictionary <string, string> HT1 = new Dictionary <string, string>(); Dictionary <string, string> HT2 = new Dictionary <string, string>(); HT1.Add("key", "value1"); HT2.Add("key", "value2"); // Act List <string[]> result = leftJoin.LeftJoiner(HT1, HT2); // Assert List <string[]> expected = new List <string[]>(); string[] expectedArray = new string[3] { "key", "value1", "value2" }; expected.Add(expectedArray); Assert.Equal(expected, result); }