public string BuildCssClass() { Ensures.IsValid(IsValidColor(Color), "The color is supported."); return(new CssClassBuilder(CSS_CLASS_PREFIX) .Append("gradient", () => IsGradient) .Append(() => Color.GetCssClassPart(), () => Color != Color.None && Color != Color.Muted) .Build()); }
public void ValidSucceedsWhenConditionIsTrue() { var action = () => Ensures.IsValid(true, string.Empty); action.Should().NotThrow <InvalidOperationException>(); }
public void ValidSucceedsWhenConditionIsFalse() { var action = () => Ensures.IsValid(false, "It is an error"); action.Should().ThrowExactly <InvalidOperationException>().WithMessage("It is an error"); }
public void ValidGenericSucceedsWhenConditionIsTrue() { var action = () => Ensures.IsValid <Exception>(true); action.Should().NotThrow <Exception>(); }
public void ValidGenericSucceedsWhenConditionIsFalse() { var action = () => Ensures.IsValid <Exception>(false); action.Should().ThrowExactly <Exception>(); }