コード例 #1
0
        public void ConstructorSetsParameterInfo() {
            // Arrange
            ParameterInfo pInfo = typeof(MyController).GetMethod("Foo").GetParameters()[0];

            // Act
            ReflectedParameterDescriptor pd = new ReflectedParameterDescriptor(pInfo, new Mock<ActionDescriptor>().Object);

            // Assert
            Assert.AreSame(pInfo, pd.ParameterInfo);
        }
コード例 #2
0
        public void ConstructorSetsActionDescriptorProperty() {
            // Arrange
            ParameterInfo pInfo = typeof(MyController).GetMethod("Foo").GetParameters()[0];
            ActionDescriptor ad = new Mock<ActionDescriptor>().Object;

            // Act
            ReflectedParameterDescriptor pd = new ReflectedParameterDescriptor(pInfo, ad);

            // Assert
            Assert.AreSame(ad, pd.ActionDescriptor);
        }
コード例 #3
0
 public DescribedMvcActionParameterInfo(ParameterDescriptor paramDescr, ActionInfo action)
     : base(action)
 {
     this.paramDescr = paramDescr;
      this.reflectedParamDescr = paramDescr as ReflectedParameterDescriptor;
 }