public void SqlBagTest() { var whereBuilder = new SqlWhereClauseBuilder(); this._operators.ForEach(o => { whereBuilder.AddParameterValue(o.Item1, o.Item2, o.Item3); }); var parameters = whereBuilder.GetParameterAndValues(); var parameterBuilder = new SqlParameterBuilder(); foreach (var p in parameters) { parameterBuilder.AddParameterValue(p.Key, p.Value); } var parames = parameterBuilder.GetParameters(); var result = new StringBuilder(); foreach (var p in parames) { result.AppendFormat("{0}:{1};", p.ParameterName, p.Value); } Assert.Fail(result.ToString(), result); }
public void SqlWhereClauseBuilderTest() { var whereBuilder = new SqlWhereClauseBuilder(); this._operators.ForEach(o => { whereBuilder.AddParameterValue(o.Item1, o.Item2, o.Item3); }); var whereResult = whereBuilder.ToString(); //Assert.IsTrue(String.IsNullOrWhiteSpace(whereResult), whereResult); var paramResult = new StringBuilder(); var parameters = whereBuilder.GetParameterAndValues(); foreach (var p in parameters) { paramResult.AppendFormat("{0}:{1};", p.Key, p.Value); } var result = whereResult + paramResult.ToString(); Assert.Fail(result, result); }