public void SutIsBehaviorExpectation()
        {
            // Arrange
            // Act
            var sut = new CompositeBehaviorExpectation();

            // Assert
            Assert.IsAssignableFrom <IBehaviorExpectation>(sut);
        }
Exemplo n.º 2
0
        public void SutIsBehaviorExpectation()
        {
            // Fixture setup
            // Exercise system
            var sut = new CompositeBehaviorExpectation();

            // Verify outcome
            Assert.IsAssignableFrom <IBehaviorExpectation>(sut);
            // Teardown
        }
        public void ConstructedWithEnumerableBehaviorExpectationsIsCorrect()
        {
            // Arrange
            var expectations = new[] { new DelegatingBehaviorExpectation(), new DelegatingBehaviorExpectation(), new DelegatingBehaviorExpectation() }.Cast <IBehaviorExpectation>();
            var sut = new CompositeBehaviorExpectation(expectations);
            // Act
            var result = sut.BehaviorExpectations;

            // Assert
            Assert.True(expectations.SequenceEqual(result));
        }
Exemplo n.º 4
0
        public void ConstructedWithEnumerableBehaviorExpectationsIsCorrect()
        {
            // Fixture setup
            var expectations = new[] { new DelegatingBehaviorExpectation(), new DelegatingBehaviorExpectation(), new DelegatingBehaviorExpectation() }.Cast <IBehaviorExpectation>();
            var sut = new CompositeBehaviorExpectation(expectations);
            // Exercise system
            var result = sut.BehaviorExpectations;

            // Verify outcome
            Assert.True(expectations.SequenceEqual(result));
            // Teardown
        }
        public void VerifyVerifiesAllBehaviorExpectations()
        {
            // Arrange
            var observedCommands = new List <IGuardClauseCommand>();
            var expectations     = Enumerable.Repeat(new DelegatingBehaviorExpectation {
                OnVerify = observedCommands.Add
            }, 3).ToArray();
            var sut = new CompositeBehaviorExpectation(expectations);

            var cmd = new DelegatingGuardClauseCommand();

            // Act
            sut.Verify(cmd);
            // Assert
            Assert.Equal(expectations.Length, observedCommands.Count(c => cmd.Equals(c)));
        }
Exemplo n.º 6
0
        public void VerifyVerifiesAllBehaviorExpectations()
        {
            // Fixture setup
            var observedCommands = new List <IGuardClauseCommand>();
            var expectations     = Enumerable.Repeat(new DelegatingBehaviorExpectation {
                OnVerify = observedCommands.Add
            }, 3).ToArray();
            var sut = new CompositeBehaviorExpectation(expectations);

            var cmd = new DelegatingGuardClauseCommand();

            // Exercise system
            sut.Verify(cmd);
            // Verify outcome
            Assert.Equal(expectations.Length, observedCommands.Count(c => cmd.Equals(c)));
            // Teardown
        }