using FluentAssertions;
using Xunit;
using ZB.MOM.WW.LmxProxy.Host.Domain;

namespace ZB.MOM.WW.LmxProxy.Host.Tests.Domain
{
    public class QualityExtensionsTests
    {
        [Theory]
        [InlineData(Quality.Good, true)]
        [InlineData(Quality.Good_LocalOverride, true)]
        [InlineData(Quality.Uncertain, false)]
        [InlineData(Quality.Bad, false)]
        public void IsGood(Quality q, bool expected)
        {
            q.IsGood().Should().Be(expected);
        }

        [Theory]
        [InlineData(Quality.Uncertain, true)]
        [InlineData(Quality.Uncertain_LastUsable, true)]
        [InlineData(Quality.Good, false)]
        [InlineData(Quality.Bad, false)]
        public void IsUncertain(Quality q, bool expected)
        {
            q.IsUncertain().Should().Be(expected);
        }

        [Theory]
        [InlineData(Quality.Bad, true)]
        [InlineData(Quality.Bad_CommFailure, true)]
        [InlineData(Quality.Good, false)]
        [InlineData(Quality.Uncertain, false)]
        public void IsBad(Quality q, bool expected)
        {
            q.IsBad().Should().Be(expected);
        }
    }
}
