Beispiel #1
0
        public void SutIsRequestSpecification()
        {
            // Arrange
            // Act
            var sut = new ImplementedInterfaceSpecification(typeof(object));

            // Assert
            Assert.IsAssignableFrom <IRequestSpecification>(sut);
        }
Beispiel #2
0
        public void IsSatisfiedByWithNullRequestShouldThrowArgumentNullException()
        {
            // Arrange
            var sut = new ImplementedInterfaceSpecification(typeof(object));

            // Act & assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.IsSatisfiedBy(null));
        }
Beispiel #3
0
        public void InitializeWithTargetTypeShouldSetCorrespondingProperty()
        {
            // Arrange
            var targetType = typeof(object);
            // Act
            var sut = new ImplementedInterfaceSpecification(targetType);

            // Assert
            Assert.Equal(targetType, sut.TargetType);
        }
Beispiel #4
0
        public void IsSatisfiedByWithNullRequestShouldThrowArgumentNullException()
        {
            // Fixture setup
            var sut = new ImplementedInterfaceSpecification(typeof(object));

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.IsSatisfiedBy(null));
            // Teardown
        }
Beispiel #5
0
        public void SutIsRequestSpecification()
        {
            // Fixture setup
            // Exercise system
            var sut = new ImplementedInterfaceSpecification(typeof(object));

            // Verify outcome
            Assert.IsAssignableFrom <IRequestSpecification>(sut);
            // Teardown
        }
Beispiel #6
0
        public void IsSatisfiedByWithInvalidRequestShouldReturnFalse(object request)
        {
            // Arrange
            var targetType = typeof(NoopInterfaceImplementer);
            var sut        = new ImplementedInterfaceSpecification(targetType);
            // Act
            var result = sut.IsSatisfiedBy(request);

            // Assert
            Assert.False(result);
        }
Beispiel #7
0
        public void InitializeWithTargetTypeShouldSetCorrespondingProperty()
        {
            // Fixture setup
            var targetType = typeof(object);
            // Exercise system
            var sut = new ImplementedInterfaceSpecification(targetType);

            // Verify outcome
            Assert.Equal(targetType, sut.TargetType);
            // Teardown
        }
Beispiel #8
0
        public void IsSatisfiedByWithRequestForNonInterfaceTypeShouldReturnFalse()
        {
            // Arrange
            var targetType    = typeof(NoopInterfaceImplementer);
            var requestedType = typeof(string);
            var sut           = new ImplementedInterfaceSpecification(targetType);
            // Act
            var result = sut.IsSatisfiedBy(requestedType);

            // Assert
            Assert.False(result);
        }
Beispiel #9
0
        public void IsSatisfiedByWithInvalidRequestShouldReturnFalse(object request)
        {
            // Fixture setup
            var targetType = typeof(NoopInterfaceImplementer);
            var sut        = new ImplementedInterfaceSpecification(targetType);
            // Exercise system
            var result = sut.IsSatisfiedBy(request);

            // Verify outcome
            Assert.False(result);
            // Teardown
        }
Beispiel #10
0
        public void IsSatisfiedByWithRequestForImplementedInterfaceShouldReturnTrue()
        {
            // Fixture setup
            var targetType    = typeof(NoopInterfaceImplementer);
            var requestedType = typeof(IInterface);
            var sut           = new ImplementedInterfaceSpecification(targetType);
            // Exercise system
            var result = sut.IsSatisfiedBy(requestedType);

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