コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }