public void WithLifetimeValidationShouldValidateInput() { // Given TokenValidationParameters options = null; // When, Then Assert.Throws <ArgumentNullException>(() => options.WithLifetimeValidation()); }
public void ShouldDeactivateLifetimeValidation() { // Given var options = new TokenValidationParameters(); // When options .WithLifetimeValidation() .WithoutLifetimeValidation(); // Then Assert.False(options.ValidateLifetime); }
public void ShouldActivateLifetimeValidation() { // Given var options = new TokenValidationParameters(); var validator = new LifetimeValidator((w, x, y, z) => true); // When options.WithLifetimeValidation(validator); // Then Assert.True(options.ValidateLifetime); Assert.Equal(validator, options.LifetimeValidator); }