public void BasicUsageSound() { //Arrange var functions = new Mock <Functions>(); var namespaceCtx = new IntPtr(37); var target = new AsyncManager(functions.Object); //Act var cts = target.GetCancellationTokenForCommand(99); bool cancellationCalled = false; cts.Token.Register(() => { cancellationCalled = true; }); target.ProcessCancelCommand(99); //Assert Assert.True(cancellationCalled); }