using FluentAssertions;
using StackExchange.Redis;

public class QsofaCalculatorTests
{
    [Fact]
    public void MeetsCriterion_RespRate22_ReturnsTrue() =>
        QsofaCalculator.MeetsCriterion("RESP_RATE", 22m).Should().BeTrue();

    [Fact]
    public void MeetsCriterion_RespRate21_ReturnsFalse() =>
        QsofaCalculator.MeetsCriterion("RESP_RATE", 21m).Should().BeFalse();

    [Fact]
    public void MeetsCriterion_SystolicBp100_ReturnsTrue() =>
        QsofaCalculator.MeetsCriterion("SYSTOLIC_BP", 100m).Should().BeTrue();

    [Fact]
    public void MeetsCriterion_SystolicBp101_ReturnsFalse() =>
        QsofaCalculator.MeetsCriterion("SYSTOLIC_BP", 101m).Should().BeFalse();

    [Fact]
    public void MeetsCriterion_Avpu1_ReturnsTrue() =>
        QsofaCalculator.MeetsCriterion("AVPU", 1m).Should().BeTrue();

    [Fact]
    public void MeetsCriterion_Avpu0_ReturnsFalse() =>
        QsofaCalculator.MeetsCriterion("AVPU", 0m).Should().BeFalse();

    [Fact]
    public void CountActiveCriteria_TwoOfThree_Returns2()
    {
        var values = new RedisValue[] { "24", RedisValue.Null, "95" };

        QsofaCalculator.CountActiveCriteria(values).Should().Be(2);
    }
}
