| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using OneShot.Core;
- using Xunit;
- namespace OneShot.Tests
- {
- public class SessionGateTests
- {
- [Fact]
- public void HasEnteredScene_IsFalse_Initially()
- {
- SessionGate gate = new SessionGate();
- Assert.False(gate.HasEnteredScene);
- }
- [Fact]
- public void MarkEnteredScene_SetsFlagTrue()
- {
- SessionGate gate = new SessionGate();
- gate.MarkEnteredScene();
- Assert.True(gate.HasEnteredScene);
- }
- [Fact]
- public void Reset_ClearsFlag()
- {
- SessionGate gate = new SessionGate();
- gate.MarkEnteredScene();
- gate.Reset();
- Assert.False(gate.HasEnteredScene);
- }
- [Fact]
- public void ShouldBlockStart_IsTrue_WhenEnabledAndEntered()
- {
- SessionGate gate = new SessionGate();
- gate.MarkEnteredScene();
- Assert.True(gate.ShouldBlockStart(true));
- }
- [Fact]
- public void ShouldBlockStart_IsFalse_WhenEnabledButNotEntered()
- {
- SessionGate gate = new SessionGate();
- Assert.False(gate.ShouldBlockStart(true));
- }
- [Fact]
- public void ShouldBlockStart_IsAlwaysFalse_WhenDisabled()
- {
- SessionGate gate = new SessionGate();
- gate.MarkEnteredScene();
- Assert.False(gate.ShouldBlockStart(false));
- }
- }
- }
|