internal void GetBodyVariableSetString_FalseValue(MetadataOracleBoolean metadata, string name, ParameterDirection direction) { var param = new ParamBoolean(false, direction, metadata); param.SetParameterName(name); var actual = param.GetBodyVariableSetString(); Assert.Equal($"{name} := false;", actual); }
internal void GetOracleParameter_InputParameter_CallsMetadata(int startNumber, bool?value, string name) { var metadata = new Mock <MetadataOracleBoolean>(MockBehavior.Strict); var param = new ParamBoolean(value, ParameterDirection.Input, metadata.Object); param.SetParameterName(name); var oracleParam = param.GetOracleParameter(startNumber); Assert.NotNull(oracleParam); Assert.Equal(name, oracleParam.ParameterName); Assert.Equal(value, oracleParam.Value); }
internal void GetDeclareLine_InputOuput_CallsMetadata(Mock <MetadataOracleBoolean> metadata, bool?value, string declareExpected, string name) { metadata.Setup(m => m.GetDeclareLine(name)) .Returns(declareExpected) .Verifiable(); var param = new ParamBoolean(value, ParameterDirection.InputOutput, metadata.Object); param.SetParameterName(name); var declare = param.GetDeclareLine(); Assert.Equal(declareExpected, declare); metadata.Verify(); }
internal void PrepareOutputParameter(int startNumber, Mock <MetadataOracleBoolean> metadata, bool?value, string name, string outputStr, OracleParameter expectedParameter) { metadata.Setup(m => m.OutputString(startNumber, name)) .Returns(outputStr) .Verifiable(); metadata.Setup(m => m.GetOracleParameter(value, startNumber)) .Returns(expectedParameter); var param = new ParamBoolean(value, ParameterDirection.Output, metadata.Object); param.SetParameterName(name); var prepared = param.PrepareOutputParameter(startNumber); metadata.Verify(); Assert.NotNull(prepared); Assert.Equal(outputStr, prepared.OutputString); Assert.Equal(expectedParameter, prepared.OracleParameter); Assert.Equal(param, prepared.Parameter); }