Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. public delegate int CalculateDelegate();
  2.  
  3. public class TestClass
  4. {
  5.     CalculateDelegate Calc{ get; }
  6. }
  7.  
  8. public void Test()
  9. {
  10.     TestClass c = new TestClass
  11.     {
  12.         CalculateDelegate = delegate { return 42; }
  13.     }
  14.     Assert.Equal(c.CalculateDelegate() == 42);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement