From 6871079b05c024585ed19da7b816b48fac90ff80 Mon Sep 17 00:00:00 2001 From: Snorre Aldstedt Date: Tue, 5 Aug 2025 11:55:06 +0200 Subject: [PATCH 1/2] Test PR --- csharp-fundamentals-lists.Main/Core.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/csharp-fundamentals-lists.Main/Core.cs b/csharp-fundamentals-lists.Main/Core.cs index 185c6d3..451eafc 100644 --- a/csharp-fundamentals-lists.Main/Core.cs +++ b/csharp-fundamentals-lists.Main/Core.cs @@ -32,6 +32,7 @@ public List Question1() //write code here + // Test PR return _iceCreams; } From b04aec7c268018662ad0547b22034847ceb45711 Mon Sep 17 00:00:00 2001 From: Snorre Aldstedt Date: Tue, 5 Aug 2025 12:08:52 +0200 Subject: [PATCH 2/2] fix to pass tests --- csharp-fundamentals-lists.Main/Core.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/csharp-fundamentals-lists.Main/Core.cs b/csharp-fundamentals-lists.Main/Core.cs index 451eafc..8a02551 100644 --- a/csharp-fundamentals-lists.Main/Core.cs +++ b/csharp-fundamentals-lists.Main/Core.cs @@ -33,16 +33,17 @@ public List Question1() //write code here // Test PR + _iceCreams.Add("Phish Food"); + _iceCreams.Add("Peanut Butter Cup"); return _iceCreams; } public int Question2() { - + //TODO: find the lists method that returns the number of ice creams in the list and return this. - // remove exception and write code here - throw new NotImplementedException(); + return _iceCreams.Count(); } public List Question3() { @@ -50,7 +51,7 @@ public List Question3() // The code below concatenates this.MoreIceCream to the _iceCreams list into a new results list. //TODO: you can 'chain' methods on the _iceCream list, so add another Concat to include EvenMoreIceCream (this is defined below) to the result list . e.g. _iceCreams.Concat(this.MoreIceCream).Concat(other list to concat).ToList() - List results = _iceCreams.Concat(this.MoreIceCream).ToList(); + List results = _iceCreams.Concat(this.MoreIceCream).Concat(this.EvenMoreIceCream).ToList(); return results; @@ -66,7 +67,8 @@ public List Question4() // be sure to include the MoreIceCream and EvenMoreIceCream lists - List results = _iceCreams; + List results = _iceCreams.Concat(this.MoreIceCream).Concat(this.EvenMoreIceCream).Distinct().ToList(); + ; // remove exception and write code here return results; }