using ZB.MOM.WW.ScadaBridge.CentralUI.Services;
using Xunit;

namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests;

public class PollGateTests
{
    [Fact]
    public void TryEnter_SecondCallWhileHeld_ReturnsFalse()
    {
        var gate = new PollGate();
        Assert.True(gate.TryEnter());
        Assert.False(gate.TryEnter());
        gate.Exit();
        Assert.True(gate.TryEnter());
    }
}
