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); }
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); } }
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); } }
private void ValidateOutputParameter <T>(CallParameterInfo parameter, string expectedName) { this.ValidateOutputParameter <T, T>(parameter, expectedName); }
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); }
private void ValidateNonNullInputParameter <ParameterType, ValueType>(CallParameterInfo parameter, string expectedName) { this.ValidateNullInputParameter <ParameterType>(parameter, expectedName); Assert.AreEqual <string>(typeof(ValueType).FullName, parameter.Value.GetType().FullName); }