public void TestMultipleActions() { var am = new ActionMap <int, int>(); int value1 = 0, value2 = 0; am.OnAdd(1, x => value1 = x); am.OnAdd(1, x => value2 = x); am.Add(1, 2); Assert.Equal(2, value1); Assert.Equal(2, value2); }
public void TestNotAdded() { var am = new ActionMap <int, int>(); int value = 0; am.OnAdd(1, x => value = x); am.Add(2, 2); Assert.Equal(0, value); }