diff --git a/gradebook/test/GradeBook.Tests/TypeTests.cs b/gradebook/test/GradeBook.Tests/TypeTests.cs index 7b63549..db76876 100644 --- a/gradebook/test/GradeBook.Tests/TypeTests.cs +++ b/gradebook/test/GradeBook.Tests/TypeTests.cs @@ -4,8 +4,26 @@ using Xunit; namespace GradeBook.Tests { using GradeBook; + + public delegate string WriteLogDelegate(string logMessage); + public class TypeTests { + [Fact] + public void WriteLogDelegateCanPointToMethod() + { + string msg = "test"; + + WriteLogDelegate log = new WriteLogDelegate(ReturnMessage); // Instantiate a delegate + var result = log(msg); // Invoking a delegate + Assert.Equal(result, msg); + } + + string ReturnMessage(string message) + { + return message; + } + [Fact] public void ValueTypesAlsoPassByValue() {