public void GetOrCreateOverride_NonVirtualMethod()
        {
            var method = ReflectionObjectMother.GetSomeNonVirtualMethod();

            Assert.That(
                () => _factory.GetOrCreateOverride(_mutableType, method, out _isNewlyCreated),
                Throws.ArgumentException
                .With.ArgumentExceptionMessageEqualTo(
                    "Only virtual methods can be overridden.", "overriddenMethod"));
        }
예제 #2
0
        public void GetOrCreateOverride_NonVirtualMethod()
        {
            var method = ReflectionObjectMother.GetSomeNonVirtualMethod();

            _factory.GetOrCreateOverride(_mutableType, method, out _isNewlyCreated);
        }