/// <summary> /// The Mathset_Figure_Helper_Test. /// </summary> /// <param name="str">The str<see cref="IFigures"/>.</param> /// <param name="fom">The fom<see cref="MathsetMockModel"/>.</param> /// <returns>The <see cref="IFigure"/>.</returns> private IFigure Mathset_Figure_Helper_Test(IFigures str, MathsetMockModel fom) { IFigure rts = str.NewFigure(); for (int i = 1; i < str.Rubrics.Count; i++) { MemberInfo r = str.Rubrics[i].RubricInfo; if (r.MemberType == MemberTypes.Field) { var fi = fom.GetType().GetField(((FieldInfo)r).Name); if (fi != null) { rts[r.Name] = fi.GetValue(fom); } } if (r.MemberType == MemberTypes.Property) { var pi = fom.GetType().GetProperty(((PropertyInfo)r).Name); if (pi != null) { rts[r.Name] = pi.GetValue(fom); } } } return(rts); }
/// <summary> /// Initializes a new instance of the <see cref="MathsetTest"/> class. /// </summary> public MathsetTest() { instFig = new Figure(typeof(MathsetMockModel)); instMtic = new Figures(instFig, "Figures_Mathset_Test"); spcMtic = instMtic.Combine(); MathsetMockModel fom = new MathsetMockModel(); for (int i = 0; i < 1000 * 1000; i++) { var f = Mathset_Figure_Helper_Test(spcMtic, fom); f["NetPrice"] = (double)f["NetPrice"] + i; f["NetCost"] = (double)f["NetPrice"] / 2; spcMtic.Add(i, f); } }