public Task TestRevoke() { var mockController = new Mock <IParseSessionController>(); ParseCorePlugins.Instance.SessionController = mockController.Object; CancellationTokenSource source = new CancellationTokenSource(); return(ParseSession.RevokeAsync("r:someSession", source.Token).ContinueWith(t => { Assert.False(t.IsFaulted); Assert.False(t.IsCanceled); mockController.Verify(obj => obj.RevokeAsync(It.Is <string>(sessionToken => sessionToken == "r:someSession"), source.Token), Times.Exactly(1)); })); }
public static Task RevokeAsync(string sessionToken, CancellationToken cancellationToken) { return(ParseSession.RevokeAsync(sessionToken, cancellationToken)); }
public static Task RevokeAsync(string sessionToken, CancellationToken cancellationToken) => ParseSession.RevokeAsync(sessionToken, cancellationToken);