public void TestReadPlots()
        {
            using (var ds = new CruiseDAL.DAL(":memory:", true))
            {
                var unit = new CuttingUnit()
                {
                    Code = "1"
                };

                var st = new PlotStratum()
                {
                    Code   = "1",
                    Method = CruiseMethods.THREEPPNT
                };

                ds.Insert(unit);

                ds.Insert(st);

                ds.Insert(new Plot()
                {
                    CuttingUnit = unit,
                    Stratum     = st,
                    PlotNumber  = 1
                });

                st.DAL = ds;
                st.PopulatePlots(unit.CuttingUnit_CN.Value);

                st.Plots.Should().NotBeNullOrEmpty();
                st.Plots.Should().OnlyContain(x => x is Plot3PPNT);
            }
        }
Exemple #2
0
        private void _plotInfo_BTN_Click(object sender, EventArgs e)
        {
            using (var ds = new DAL())
            {
                var stratum = new PlotStratum()
                {
                    DAL = ds, Code = "1", Method = "something"
                };
                var unit = new CuttingUnit()
                {
                    DAL = ds, Code = "1"
                };
                ds.Insert(unit, OnConflictOption.Default);
                ds.Insert(stratum, OnConflictOption.Default);
                stratum.PopulatePlots(unit.CuttingUnit_CN.Value);

                var plot = new Plot()
                {
                    Stratum = stratum
                };

                using (var view = new FormPlotInfo())
                {
                    view.ShowDialog(plot, stratum, false);
                }
            }
        }