From 61d03491e2049420729028f77aa3062fd80d675c Mon Sep 17 00:00:00 2001 From: Pedro Herrera Date: Thu, 12 Dec 2019 23:36:14 -0600 Subject: [PATCH] Fixed collection assert error --- .gitignore | 1 + TheKoans/AboutMethods.cs | 7 ++++--- TheKoans/KoanHelper.cs | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5992cbb..d312c68 100644 --- a/.gitignore +++ b/.gitignore @@ -143,3 +143,4 @@ $RECYCLE.BIN/ # Mac crap .DS_Store +/.vs/csharp-koans/v16 diff --git a/TheKoans/AboutMethods.cs b/TheKoans/AboutMethods.cs index e52c35e..e2789e2 100644 --- a/TheKoans/AboutMethods.cs +++ b/TheKoans/AboutMethods.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TheKoans @@ -51,7 +52,7 @@ public void ExtensionMethodsWithParameters() [TestMethod] public void ExtensionMethodsWithVariableParameters() { - CollectionAssert.AreEqual(FILL_ME_IN, this.MethodWithVariableArguments("Cory", "Will", "Corey")); + CollectionAssert.AreEqual(FILL_ME_IN2, this.MethodWithVariableArguments("Cory", "Will", "Corey")); } //Extension methods can extend any class my referencing @@ -75,7 +76,7 @@ private string[] LocalMethodWithVariableParameters(params string[] names) [TestMethod] public void LocalMethodsWithVariableParams() { - CollectionAssert.AreEqual(FILL_ME_IN, this.LocalMethodWithVariableParameters("Cory", "Will", "Corey")); + CollectionAssert.AreEqual(FILL_ME_IN2, this.LocalMethodWithVariableParameters("Cory", "Will", "Corey")); } //Note how we called the method by saying "this.LocalMethodWithVariableParameters" @@ -84,7 +85,7 @@ public void LocalMethodsWithVariableParams() [TestMethod] public void LocalMethodsWithoutExplicitReceiver() { - CollectionAssert.AreEqual(FILL_ME_IN, LocalMethodWithVariableParameters("Cory", "Will", "Corey")); + CollectionAssert.AreEqual(FILL_ME_IN2, LocalMethodWithVariableParameters("Cory", "Will", "Corey")); } //But it is required for Extension Methods, since it needs diff --git a/TheKoans/KoanHelper.cs b/TheKoans/KoanHelper.cs index c270ade..6ebd864 100644 --- a/TheKoans/KoanHelper.cs +++ b/TheKoans/KoanHelper.cs @@ -1,11 +1,12 @@ using System; - +using System.Collections; namespace TheKoans { public class KoanHelper { public static object FILL_ME_IN = new Object(); + public static ICollection FILL_ME_IN2 = new ArrayList(); } //This is just used when we need a type