コード例 #1
0
        public void SetGenericParameterConstraints_ValueTypeBaseConstraint()
        {
            var message = "A generic parameter cannot be constrained by a value type.\r\nParameter name: constraints";

            Assert.That(
                () => _parameter.SetGenericParameterConstraints(new[] { ReflectionObjectMother.GetSomeValueType() }),
                Throws.ArgumentException.With.Message.EqualTo(message));
            Assert.That(
                () => _parameter.SetGenericParameterConstraints(new[] { typeof(ValueType) }),
                Throws.ArgumentException.With.Message.EqualTo(message));
        }