Ejemplo n.º 1
0
        public void IsSatisfiedByWithNullRequestShouldThrowArgumentNullException()
        {
            // Arrange
            var sut = new DirectBaseTypeSpecification(typeof(object));

            // Act & assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.IsSatisfiedBy(null));
        }
        public void IsSatisfiedByWithNullRequestShouldThrowArgumentNullException()
        {
            // Fixture setup
            var sut = new DirectBaseTypeSpecification(typeof(object));

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.IsSatisfiedBy(null));
            // Teardown
        }
Ejemplo n.º 3
0
        public void IsSatisfiedByWithInvalidRequestShouldReturnFalse(object request)
        {
            // Arrange
            var sut = new DirectBaseTypeSpecification(typeof(ConcreteType));
            // Act
            var result = sut.IsSatisfiedBy(request);

            // Assert
            Assert.False(result);
        }
        public void IsSatisfiedByWithInvalidRequestShouldReturnFalse(object request)
        {
            // Fixture setup
            var sut = new DirectBaseTypeSpecification(typeof(ConcreteType));
            // Exercise system
            var result = sut.IsSatisfiedBy(request);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Ejemplo n.º 5
0
        public void IsSatisfiedByWithRequestForIncompatibleTypeShouldReturnFalse()
        {
            // Arrange
            var targetType    = typeof(ConcreteType);
            var requestedType = typeof(string);
            var sut           = new DirectBaseTypeSpecification(targetType);
            // Act
            var result = sut.IsSatisfiedBy(requestedType);

            // Assert
            Assert.False(result);
        }
Ejemplo n.º 6
0
        public void IsSatisfiedByWithRequestForDirectBaseTypeShouldReturnTrue()
        {
            // Arrange
            var targetType    = typeof(ConcreteType);
            var requestedType = typeof(AbstractType);
            var sut           = new DirectBaseTypeSpecification(targetType);
            // Act
            var result = sut.IsSatisfiedBy(requestedType);

            // Assert
            Assert.True(result);
        }
        public void IsSatisfiedByWithRequestForIndirectBaseTypeShouldReturnFalse()
        {
            // Fixture setup
            var targetType    = typeof(ConcreteType);
            var requestedType = typeof(object);
            var sut           = new DirectBaseTypeSpecification(targetType);
            // Exercise system
            var result = sut.IsSatisfiedBy(requestedType);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }