示例#1
0
 private void ValidateOutputParameter <ParameterType, ValueType>(CallParameterInfo parameter, string expectedName)
 {
     Assert.AreEqual <string>(expectedName, parameter.Name);
     Assert.AreEqual <string>(typeof(ParameterType).FullName, parameter.ParameterType.FullName);
     Assert.IsNull(parameter.Value);
     Assert.AreEqual <FieldDirection>(FieldDirection.Out, parameter.Direction);
 }
示例#2
0
 private void ValidateObjectInputParameter <T>(CallParameterInfo parameter, string expectedName, T expectedValue)
 {
     if (expectedValue != null)
     {
         this.ValidateNonNullInputParameter <object, string>(parameter, expectedName);
         Assert.AreEqual <T>(expectedValue, (T)parameter.Value);
     }
     else
     {
         this.ValidateNullInputParameter <object>(parameter, expectedName);
         Assert.IsNull(parameter.Value);
     }
 }
示例#3
0
        private void ValidateRefParameter <T>(CallParameterInfo parameter, string expectedName, T expectedValue)
        {
            Assert.AreEqual <string>(expectedName, parameter.Name);
            Assert.AreEqual <string>(typeof(T).FullName, parameter.ParameterType.FullName);
            if (parameter.Value != null)
            {
                Assert.AreEqual <string>(typeof(T).FullName, parameter.Value.GetType().FullName);
            }

            Assert.AreEqual <FieldDirection>(FieldDirection.Ref, parameter.Direction);

            // Cannot compare two object()s
            if (expectedValue.GetType() != typeof(object))
            {
                Assert.AreEqual <T>(expectedValue, (T)parameter.Value);
            }
        }
示例#4
0
 private void ValidateOutputParameter <T>(CallParameterInfo parameter, string expectedName)
 {
     this.ValidateOutputParameter <T, T>(parameter, expectedName);
 }
示例#5
0
 private void ValidateNullInputParameter <T>(CallParameterInfo parameter, string expectedName)
 {
     Assert.AreEqual <string>(expectedName, parameter.Name);
     Assert.AreEqual <string>(typeof(T).FullName, parameter.ParameterType.FullName);
     Assert.AreEqual <FieldDirection>(FieldDirection.In, parameter.Direction);
 }
示例#6
0
 private void ValidateNonNullInputParameter <ParameterType, ValueType>(CallParameterInfo parameter, string expectedName)
 {
     this.ValidateNullInputParameter <ParameterType>(parameter, expectedName);
     Assert.AreEqual <string>(typeof(ValueType).FullName, parameter.Value.GetType().FullName);
 }