public Task WeakVerifyStaticCall() { var source = new WeakStaticCallSource(); source.Add(StaticCallReceiver.Receive); var information = new StaticCallInformation(); source.Invoker(source, information); Assert.That(information.CallCount, Is.EqualTo(1)); return(Task.CompletedTask); }
public Task OrdinaryVerifyStaticUnsubscribedCall() { var source = new OrdinaryStaticCallSource(); source.Add(StaticCallReceiver.Receive); source.Remove(StaticCallReceiver.Receive); var information = new StaticCallInformation(); source.Invoker(source, information); Assert.That(information.CallCount, Is.EqualTo(0)); return(Task.CompletedTask); }
public static void Receive(object sender, StaticCallInformation args) { args.CallCount++; }