private IFigure Figure_Compilation_Helper_Test(Figure str, FieldsAndPropertiesModel fom)
        {
            IFigure rts = str.Combine();

            fom.Id = 202;
            rts[0] = 202;
            Assert.Equal(fom.Id, rts[0]);
            rts["Id"] = 404;
            Assert.NotEqual(fom.Id, rts[nameof(fom.Id)]);
            rts[nameof(fom.Name)] = fom.Name;
            Assert.Equal(fom.Name, rts[nameof(fom.Name)]);
            rts.SerialCode = new Ussn(DateTime.Now.ToBinary());
            string hexTetra = rts.SerialCode.ToString();
            Ussn   ssn      = new Ussn(hexTetra);

            Assert.Equal(ssn, rts.SerialCode);

            for (int i = 1; i < str.Rubrics.Count; i++)
            {
                var ri = str.Rubrics[i].RubricInfo;
                if (ri.MemberType == MemberTypes.Field)
                {
                    var fi = fom.GetType().GetField(((FieldInfo)ri).Name);
                    if (fi != null)
                    {
                        rts[ri.Name] = fi.GetValue(fom);
                    }
                }
                if (ri.MemberType == MemberTypes.Property)
                {
                    var pi = fom.GetType().GetProperty(((PropertyInfo)ri).Name);
                    if (pi != null)
                    {
                        (rts)[ri.Name] = pi.GetValue(fom);
                    }
                }
            }

            for (int i = 1; i < str.Rubrics.Count; i++)
            {
                var r = str.Rubrics[i].RubricInfo;
                if (r.MemberType == MemberTypes.Field)
                {
                    var fi = fom.GetType().GetField(((FieldInfo)r).Name);
                    if (fi != null)
                    {
                        Assert.Equal((rts)[r.Name], fi.GetValue(fom));
                    }
                }
                if (r.MemberType == MemberTypes.Property)
                {
                    var pi = fom.GetType().GetProperty(((PropertyInfo)r).Name);
                    if (pi != null)
                    {
                        Assert.Equal((rts)[r.Name], pi.GetValue(fom));
                    }
                }
            }
            return(rts);
        }
        /// <summary>
        /// The Figure_Compilation_Helper_Test.
        /// </summary>
        /// <param name="str">The str<see cref="Figure"/>.</param>
        /// <param name="fom">The fom<see cref="FieldsAndPropertiesModel"/>.</param>
        /// <returns>The <see cref="IFigure"/>.</returns>
        private IFigure Figure_Compilation_Helper_Test(Figure str, FieldsAndPropertiesModel fom)
        {
            IFigure rts = str.Combine();

            for (int i = 1; i < str.Rubrics.Count; i++)
            {
                var 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);
        }
        public void Figures_SetRubrics_Test()
        {
            str = new Figure(typeof(FieldsAndPropertiesModel));
            FieldsAndPropertiesModel fom = new FieldsAndPropertiesModel();

            iRts = Figure_Compilation_Helper_Test(str, fom);

            rtsq = new Figures(str, "InstantSequence_Compilation_Test");

            var rttab = rtsq.Combine();

            Assert.Equal(rttab.Rubrics, rtsq.Rubrics);
        }
        public void Figures_NewFigure_Test()
        {
            str = new Figure(typeof(FieldsAndPropertiesModel));
            FieldsAndPropertiesModel fom = new FieldsAndPropertiesModel();

            iRts = Figure_Compilation_Helper_Test(str, fom);

            rtsq = new Figures(str, "InstantSequence_Compilation_Test");

            iRtseq = rtsq.Combine();

            IFigure rcst = iRtseq.NewFigure();

            Assert.NotNull(rcst);
        }
        public void Figures_MutatorAndAccessorByName_Test()
        {
            str = new Figure(typeof(FieldsAndPropertiesModel));
            FieldsAndPropertiesModel fom = new FieldsAndPropertiesModel();

            iRts = Figure_Compilation_Helper_Test(str, fom);

            rtsq = new Figures(str, "InstantSequence_Compilation_Test");

            iRtseq = rtsq.Combine();

            iRtseq.Add(iRtseq.NewFigure());
            iRtseq[0, nameof(fom.Name)] = iRts[nameof(fom.Name)];

            Assert.Equal(iRts[nameof(fom.Name)], iRtseq[0, nameof(fom.Name)]);
        }
        /// <summary>
        /// The FiguresLinkmap_AddFigures_A_Helper_Test.
        /// </summary>
        /// <param name="figures">The figures<see cref="IFigures"/>.</param>
        /// <returns>The <see cref="IFigures"/>.</returns>
        private IFigures FiguresLinkmap_AddFigures_A_Helper_Test(IFigures figures)
        {
            IFigures _figures            = figures;
            FieldsAndPropertiesModel fom = new FieldsAndPropertiesModel();
            IFigure  figureMock          = FiguresLinkmap_SetValues_Helper_Test(_figures, fom);
            int      idSeed      = (int)figureMock["Id"];
            DateTime seedKeyTick = DateTime.Now;

            for (int i = 0; i < 100000; i++)
            {
                IFigure figure = _figures.NewFigure();
                figure.ValueArray = figureMock.ValueArray;
                figure["Id"]      = idSeed + i;
                figure["Time"]    = seedKeyTick;
                _figures.Put(figure);
            }
            return(_figures);
        }
        public void Figures_Compile_Test()
        {
            str = new Figure(typeof(FieldsAndPropertiesModel));
            FieldsAndPropertiesModel fom = new FieldsAndPropertiesModel();

            iRts = Figure_Compilation_Helper_Test(str, fom);

            rtsq = new Figures(str, "InstantSequence_Compilation_Test");

            var rttab = rtsq.Combine();

            for (int i = 0; i < 10000; i++)
            {
                rttab.Add((long)int.MaxValue + i, rttab.NewFigure());
            }

            for (int i = 9999; i > -1; i--)
            {
                rttab[i] = rttab.Get(i + (long)int.MaxValue);
            }
        }
        /// <summary>
        /// The FiguresLinkmap_AddFigures_B_Helper_Test.
        /// </summary>
        /// <param name="figures">The figures<see cref="IFigures"/>.</param>
        /// <returns>The <see cref="IFigures"/>.</returns>
        private IFigures FiguresLinkmap_AddFigures_B_Helper_Test(IFigures figures)
        {
            IFigures _figures            = figures;
            FieldsAndPropertiesModel fom = new FieldsAndPropertiesModel();
            IFigure  figureMock          = FiguresLinkmap_SetValues_Helper_Test(_figures, fom);
            int      idSeed      = (int)figureMock["Id"];
            DateTime seedKeyTick = DateTime.Now;

            //IntPtr b = figureMock.GetStructureIntPtr();
            for (int i = 0; i < 100000; i++)
            {
                for (int y = 0; y < 3; y++)
                {
                    IFigure figure = _figures.NewFigure();
                    figure.ValueArray = figureMock.ValueArray;
                    //figure.StructureFrom(b);
                    figure["Id"]   = idSeed + i;
                    figure["Time"] = seedKeyTick.AddMinutes(y);
                    _figures.Put(figure);
                }
            }
            return(_figures);
        }