Exemplo n.º 1
0
        public void GivenFixtureWhenEpochInvalidGreaterThanCurrentEpochAndMultipleEpochChangeReasonsThenIsEpochValidReturnsFalse()
        {
            //
            //Arrange
            //
            var fixtureDelta = new Fixture
            {
                Epoch = 4,
                LastEpochChangeReason = new[] { (int)EpochChangeReason.StartTime, (int)EpochChangeReason.Participants }
            };
            int currentEpoch      = 3;
            var fixtureValidation = new FixtureValidation();

            //
            //Act
            //
            bool isEpochValid = fixtureValidation.IsEpochValid(
                fixtureDelta,
                currentEpoch);

            //
            //Assert
            //
            Assert.IsFalse(isEpochValid);
        }
Exemplo n.º 2
0
        public void GivenFixtureWhenEpochValidGreaterThanCurrentEpochButOnlyBecauseOfStartTimeEpochChangeReasonThenIsEpochValidReturnsTrue()
        {
            //
            //Arrange
            //
            var fixtureDelta = new Fixture
            {
                Epoch = 4,
                LastEpochChangeReason = new[] { (int)EpochChangeReason.StartTime }
            };
            int currentEpoch      = 3;
            var fixtureValidation = new FixtureValidation();

            //
            //Act
            //
            bool isEpochValid = fixtureValidation.IsEpochValid(
                fixtureDelta,
                currentEpoch);

            //
            //Assert
            //
            Assert.IsTrue(isEpochValid);
        }
Exemplo n.º 3
0
        public void GivenFixtureWhenEpochInvalidGreaterThanCurrentEpochAndFixtureStartTimeChangedFalseThenIsEpochValidReturnsFalse()
        {
            //
            //Arrange
            //
            var fixtureDelta = new Fixture {
                Epoch = 4
            };
            int currentEpoch      = 3;
            var fixtureValidation = new FixtureValidation();

            //
            //Act
            //
            bool isEpochValid = fixtureValidation.IsEpochValid(
                fixtureDelta,
                currentEpoch);

            //
            //Assert
            //
            Assert.IsFalse(isEpochValid);
        }
Exemplo n.º 4
0
        public void GivenFixtureWhenEpochInvalidLowerThanCurrentEpochThenIsEpochValidReturnsFalse()
        {
            //
            //Arrange
            //
            var fixtureDelta = new Fixture {
                Epoch = 3
            };
            int currentEpoch      = 4;
            var fixtureValidation = new FixtureValidation();

            //
            //Act
            //
            bool isEpochValid = fixtureValidation.IsEpochValid(
                fixtureDelta,
                currentEpoch);

            //
            //Assert
            //
            Assert.IsFalse(isEpochValid);
        }
Exemplo n.º 5
0
        public void GivenFixtureWhenEpochValidSameAsCurrentEpochThenIsEpochValidReturnsTrue()
        {
            //
            //Arrange
            //
            var fixtureDelta = new Fixture {
                Epoch = 4
            };
            int currentEpoch      = 4;
            var fixtureValidation = new FixtureValidation();

            //
            //Act
            //
            bool isEpochValid = fixtureValidation.IsEpochValid(
                fixtureDelta,
                currentEpoch);

            //
            //Assert
            //
            Assert.IsTrue(isEpochValid);
        }