コード例 #1
0
        public void Matches_returns_false_for_an_abstract_class()
        {
            var sut = new MayBeConstructedWithNewSpecification();

            Assert.That(() => sut.Matches(typeof(AbstractClass)), Is.False);
        }
コード例 #2
0
        public void Matches_returns_true_for_a_class_with_two_declared_constructors_where_one_is_parameterless()
        {
            var sut = new MayBeConstructedWithNewSpecification();

            Assert.That(() => sut.Matches(typeof(ParameterlessAndNonParameterlessConstructor)), Is.True);
        }
コード例 #3
0
        public void Matches_returns_false_for_a_class_with_one_declared_protected_parameterless_constructor()
        {
            var sut = new MayBeConstructedWithNewSpecification();

            Assert.That(() => sut.Matches(typeof(ProtectedConstructor)), Is.False);
        }
コード例 #4
0
        public void Matches_returns_true_for_a_class_with_no_declared_constructor()
        {
            var sut = new MayBeConstructedWithNewSpecification();

            Assert.That(() => sut.Matches(typeof(NoConstructor)), Is.True);
        }