Created
January 20, 2018 17:31
-
-
Save tomspilman/4a28e35b8bd1ac1a97975c09a6afe508 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
private static bool ranActionStatic; | |
struct StaticsForAction | |
{ | |
private static readonly List<int> _integers = new List<int>(); | |
static StaticsForAction() | |
{ | |
ranActionStatic = true; | |
} | |
public static void InitializeIntegerStuff() | |
{ | |
Assert.True(_integers != null); | |
Assert.True(_integers.Count == 0); | |
_integers.Add(1); | |
} | |
} | |
public static void Actions() | |
{ | |
Assert.False(ranActionStatic); | |
var a = new Action(StaticsForAction.InitializeIntegerStuff); | |
Assert.True(ranActionStatic); | |
a.Invoke(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment