Exemple #1
0
        public void Implements_generic_should_throw_when_interfaceType_is_not_an_interface_type()
        {
            var    source = typeof(Stream);
            Action act    = () => InternalExtensions.Implements <String>(source);

            act.ShouldThrow <ArgumentException>().And.ParamName.Should().Be("interfaceType");
        }
Exemple #2
0
        public void Implements_should_throw_when_interfaceType_is_null()
        {
            var    source = typeof(Stream);
            Action act    = () => InternalExtensions.Implements(source, null);

            act.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("interfaceType");
        }
Exemple #3
0
        public void Implements_should_return_true_when_source_does_implement_the_interface()
        {
            var source        = typeof(String);
            var interfaceType = typeof(IDisposable);

            InternalExtensions.Implements(source, interfaceType).Should().BeFalse();
        }
Exemple #4
0
        public void Implements_should_throw_when_source_is_null()
        {
            var    interfaceType = typeof(IDisposable);
            Action act           = () => InternalExtensions.Implements(null, interfaceType);

            act.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("source");
        }
Exemple #5
0
        public void Implements_generic_should_return_false_when_source_does_not_implement_the_interface()
        {
            var source = typeof(Stream);

            InternalExtensions.Implements <IDisposable>(source).Should().BeTrue();
        }