diff --git a/gradebook/test/GradeBook.Tests/TypeTests.cs b/gradebook/test/GradeBook.Tests/TypeTests.cs index db76876..f98c9a1 100644 --- a/gradebook/test/GradeBook.Tests/TypeTests.cs +++ b/gradebook/test/GradeBook.Tests/TypeTests.cs @@ -9,18 +9,28 @@ namespace GradeBook.Tests public class TypeTests { + int count = 0; + [Fact] public void WriteLogDelegateCanPointToMethod() { string msg = "test"; WriteLogDelegate log = new WriteLogDelegate(ReturnMessage); // Instantiate a delegate + log += ReturnMessage2; // Multi-cast delegate var result = log(msg); // Invoking a delegate Assert.Equal(result, msg); + Assert.Equal(count, 2); } string ReturnMessage(string message) { + count += 1; + return message; + } + string ReturnMessage2(string message) + { + count += 1; return message; }