Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }