public void getProcuderNameTest() { var model = new ParmModel { }; Assert.IsTrue(DataExtend.getProcuderName <ParmModel>() == "ParmModel"); Assert.IsTrue(DataExtend.getProcuderName <ParmModel1>() == "sp123"); }
public void getParamsTest() { var model = new ParmModel { Id = 1, Name = "n1", AAAge = 10 }; var data = DataExtend.getParams(model); Assert.IsNotNull(data); Assert.IsTrue(data.Count() == typeof(ParmModel).GetProperties().Length - 1); Assert.IsTrue(data.Any(m => m.ParameterName == "@Id" && m.Value.Equals(1))); Assert.IsTrue(data.Any(m => m.ParameterName == "@Name" && m.Value.Equals("n1"))); Assert.IsTrue(data.Any(m => m.ParameterName == "@age" && m.Value.Equals(10))); Assert.IsTrue(!data.Any(m => m.ParameterName == "@Address")); }