public void HasChangeFiresChange() { var token = new TestChangeToken(); bool fired = false; ChangeToken.OnChange(() => token, () => fired = true); Assert.False(fired); token.Changed(); Assert.True(fired); }
public void HasChangeFiresChangeWithState() { var token = new TestChangeToken(); object state = new object(); object callbackState = null; ChangeToken.OnChange(() => token, s => callbackState = s, state); Assert.Null(callbackState); token.Changed(); Assert.Equal(state, callbackState); }