Esempio n. 1
0
        public void CreateWillReturnFalseOnSecondCall()
        {
            // Arrange
            BooleanSwitch sut = new BooleanSwitch();

            sut.Create();
            // Act
            bool result = sut.Create();

            // Assert
            Assert.False(result, "CreateAnonymous called an even number of times");
        }
Esempio n. 2
0
        public void CreateWillReturnFalseOnSecondCall()
        {
            // Fixture setup
            BooleanSwitch sut = new BooleanSwitch();

            sut.Create();
            // Exercise system
            bool result = sut.Create();

            // Verify outcome
            Assert.False(result, "CreateAnonymous called an even number of times");
            // Teardown
        }
Esempio n. 3
0
        public void CreateWithBooleanRequestWillReturnCorrectResultOnSecondCall()
        {
            // Arrange
            var booleanRequest = typeof(bool);
            var sut            = new BooleanSwitch();
            // Act
            var dummyContainer = new DelegatingSpecimenContext();

            sut.Create(booleanRequest, dummyContainer);
            var result = sut.Create(booleanRequest, dummyContainer);

            // Assert
            Assert.False((bool)result);
        }
Esempio n. 4
0
        public void CreateWithBooleanRequestWillReturnCorrectResultOnSecondCall()
        {
            // Fixture setup
            var booleanRequest = typeof(bool);
            var sut            = new BooleanSwitch();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();

            sut.Create(booleanRequest, dummyContainer);
            var result = sut.Create(booleanRequest, dummyContainer);

            // Verify outcome
            Assert.False((bool)result);
            // Teardown
        }
Esempio n. 5
0
        public void CreateWithNullContainerDoesNotThrow()
        {
            // Arrange
            var sut = new BooleanSwitch();
            // Act
            var dummyRequest = new object();

            sut.Create(dummyRequest, null);
            // Assert (no exception indicates success)
        }
Esempio n. 6
0
        public void CreateWillReturnTrueOnFirstCall()
        {
            // Arrange
            BooleanSwitch sut = new BooleanSwitch();
            // Act
            bool result = sut.Create();

            // Assert
            Assert.True(result, "CreateAnonymous called an uneven number of times");
        }
Esempio n. 7
0
        public void CreateWithNullContainerDoesNotThrow()
        {
            // Fixture setup
            var sut = new BooleanSwitch();
            // Exercise system
            var dummyRequest = new object();

            sut.Create(dummyRequest, null);
            // Verify outcome (no exception indicates success)
            // Teardown
        }
Esempio n. 8
0
        public void CreateWithNullRequestWillReturnCorrectResult()
        {
            // Arrange
            var sut = new BooleanSwitch();
            // Act
            var dummyContainer = new DelegatingSpecimenContext();
            var result         = sut.Create(null, dummyContainer);

            // Assert
            Assert.Equal(new NoSpecimen(), result);
        }
Esempio n. 9
0
        public void CreateWithNullRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var sut = new BooleanSwitch();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result         = sut.Create(null, dummyContainer);

            // Verify outcome
            Assert.Equal(new NoSpecimen(), result);
            // Teardown
        }
Esempio n. 10
0
        public void CreateWithNonBooleanRequestWillReturnCorrectResult()
        {
            // Arrange
            var nonBooleanRequest = new object();
            var sut = new BooleanSwitch();
            // Act
            var dummyContainer = new DelegatingSpecimenContext();
            var result         = sut.Create(nonBooleanRequest, dummyContainer);
            // Assert
            var expectedResult = new NoSpecimen();

            Assert.Equal(expectedResult, result);
        }
Esempio n. 11
0
        public void CreateWithNonBooleanRequestWillReturnCorrectResult()
        {
            // Fixture setup
            var nonBooleanRequest = new object();
            var sut = new BooleanSwitch();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result         = sut.Create(nonBooleanRequest, dummyContainer);
            // Verify outcome
            var expectedResult = new NoSpecimen(nonBooleanRequest);

            Assert.Equal(expectedResult, result);
            // Teardown
        }