Created
December 17, 2010 17:50
-
-
Save mgroves/745361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class DynamicTest | |
{ | |
[Test] | |
public void DynamicTestMethod() | |
{ | |
dynamic result = GetRating(); | |
Assert.AreEqual(result.Count, 10); | |
Assert.AreEqual(result.Sum, 50); | |
} | |
public dynamic GetRating() | |
{ | |
return new { Count = 10, Sum = 50 }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On line 7, you can use "var" instead of "dynamic" too, if you want.