public void ConsolidateInventory() { Dictionary <string, int> expected = new Dictionary <string, int>() { { "SKU1", 100 }, { "SKU2", 64 }, { "SKU3", 44 }, { "SKU4", 5 } }; Exercises exercises = new Exercises(); Dictionary <string, int> actual = exercises.ConsolidateInventory( new Dictionary <string, int>() { { "SKU1", 100 }, { "SKU2", 53 }, { "SKU3", 44 } }, new Dictionary <string, int>() { { "SKU2", 11 }, { "SKU4", 5 }, }); CollectionAssert.AreEquivalent(expected, actual); }
public void ConsolidateInventory() { Dictionary <string, int> expected = new Dictionary <string, int>() { { "SKU1", 100 }, { "SKU2", 64 }, { "SKU3", 44 }, { "SKU4", 5 } }; Dictionary <string, int> actual = exercises.ConsolidateInventory(new Dictionary <string, int>() { { "SKU1", 100 }, { "SKU2", 53 }, { "SKU3", 44 } }, new Dictionary <string, int>() { { "SKU2", 11 }, { "SKU4", 5 } }); AssertCollections(expected, actual); }
public void Exercise09_ConsolidateInventory() { Dictionary <string, int> expected = new Dictionary <string, int>() { { "SKU1", 100 }, { "SKU2", 64 }, { "SKU3", 44 }, { "SKU4", 5 } }; Dictionary <string, int> actual = exercises.ConsolidateInventory(new Dictionary <string, int>() { { "SKU1", 100 }, { "SKU2", 53 }, { "SKU3", 44 } }, new Dictionary <string, int>() { { "SKU2", 11 }, { "SKU4", 5 } }); AssertCollections(expected, actual); expected = new Dictionary <string, int>() { { "SKU_4", 68 }, { "SKU_23", 86 }, { "SKU_39", 66 }, { "SKU_50", 444 }, { "SKU_X", 9 } }; actual = exercises.ConsolidateInventory(new Dictionary <string, int>() { { "SKU_4", 0 }, { "SKU_23", 53 }, { "SKU_39", 66 }, { "SKU_X", 8 } }, new Dictionary <string, int>() { { "SKU_4", 68 }, { "SKU_23", 33 }, { "SKU_50", 444 }, { "SKU_X", 1 } }); AssertCollections(expected, actual); expected = new Dictionary <string, int>() { { "Lorem", 11 }, { "Ipsum", 22 }, { "Dolor", 33 }, { "Sit", 44 }, { "Amet", 55 } }; actual = exercises.ConsolidateInventory(new Dictionary <string, int>() { { "Lorem", 11 }, { "Ipsum", 22 }, { "Dolor", 33 }, { "Sit", 44 }, { "Amet", 55 } }, new Dictionary <string, int>() { }); AssertCollections(expected, actual); expected = new Dictionary <string, int>() { { "Lorem", 66 }, { "Ipsum", 77 }, { "Dolor", 88 }, { "Sit", 99 }, { "Amet", 111 } }; actual = exercises.ConsolidateInventory(new Dictionary <string, int>() { }, new Dictionary <string, int>() { { "Lorem", 66 }, { "Ipsum", 77 }, { "Dolor", 88 }, { "Sit", 99 }, { "Amet", 111 } }); AssertCollections(expected, actual); }