-
-
Save thecodejunkie/795702 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
[Fact] | |
public void Should_be_able_to_impliclity_cast_dynamic_member_to_int() | |
{ | |
// Given | |
this.dictionary.foo = 2; | |
// When | |
int value = this.GetIntValue(this.dictionary.foo); | |
// Then | |
value.ShouldEqual(2); | |
} | |
[Fact] | |
public void Should_be_able_to_impliclity_cast_index_member_to_int() | |
{ | |
// Given | |
this.dictionary.foo = 2; | |
// When | |
int value = this.GetIntValue(this.dictionary["foo"]); | |
// Then | |
value.ShouldEqual(2); | |
} | |
private int GetIntValue(int value) | |
{ | |
return value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment