public void StyleTypeBuilderCompile_ShouldReturnStyle_WhenGreaterOrEqualThan() { var value = 1; var result = new StyleTypeBuilder <int>(value) .Default(StyleType.Info) .WhenSmallerOrEqualThan(0, StyleType.Danger) .WhenGreaterOrEqualThan(1, StyleType.Success) .Compile(); result.Should().Be(StyleType.Success); }
public void StyleTypeBuilderCompileDecimal_ShouldReturnStyle_WhenSmallerOrEqualThan() { const decimal value = 0.0m; var result = new StyleTypeBuilder <decimal>(value) .Default(StyleType.Info) .WhenSmallerOrEqualThan(0, StyleType.Danger) .WhenGreaterOrEqualThan(1, StyleType.Success) .Compile(); result.Should().Be(StyleType.Danger); }
public void StyleTypeBuilderCompile_ShouldReturnStyle_WhenThresholdWasNotReached() { var value = 1; var result = new StyleTypeBuilder <int>(value) .Default(StyleType.Info) .WhenEqualThan(0, StyleType.Light) .WhenGreaterThan(0, StyleType.Success) .WhenGreaterThan(1, StyleType.Danger) .Compile(); result.Should().Be(StyleType.Success); }