Beispiel #1
0
        public void LoadHoneyWell4()
        {
            HoneywellPBFile pf = new HoneywellPBParser().LoadFile(ROOTDIR + "NPUpld-20200930-005900M_MTL.txt", "CP01", new DateTime(2020, 09, 30));

            Assert.AreEqual(129, pf.GetTagBalanceRecords().Count);
            Assert.AreEqual(800342.050M, pf.GetTagBalanceRecords().Single(t => t.BalanceDate.Date == new DateTime(2020, 9, 30) && t.Tag == "14GZ_COMB_RAFFR").Quantity);
        }
Beispiel #2
0
        public void LoadHoneyWell3()
        {
            HoneywellPBFile pf = new HoneywellPBParser().LoadFile(ROOTDIR + "NPUpld-20200129-005900M_EDM.txt", "CP04", new DateTime(2020, 01, 31));

            Assert.AreEqual(38, pf.GetTagBalanceRecords().Count);
            Assert.AreEqual(0, pf.FailedRecords.Count);
            Assert.AreEqual(-1105871.000, pf.GetTagBalanceRecords().Single(t => t.BalanceDate.Date == new DateTime(2020, 1, 29) && t.Tag == "BCNRL").Quantity);
        }
Beispiel #3
0
        public void HoneywellPBLoadOnly()
        {
            HoneywellPBFile pf = new HoneywellPBParser().LoadFile(ROOTDIR + "NPUpld-20200928-005900M.txt", "CP01", DateTime.Now);

            Assert.IsTrue(pf.Values.ContainsKey("ACCOUNT_DATE"));
            Assert.IsTrue(pf.Values.ContainsKey("REFINERY_GAIN_LOSS"));
            Assert.IsTrue(pf.Defaults.ContainsKey("DATEFORMAT"));
            Assert.IsTrue(pf.BalanceRecords[0].Values.ContainsKey("BALANCE_GROUP_NAME"));
            Assert.IsTrue(pf.BalanceRecords[0].ProductionRecords.Count > 0);
        }
        public void ProcessHoneyPBWithSave()
        {
            string          ROOTDIR = @"..\..\..\..\sampleFiles\honeywellPB\";
            HoneywellPBFile pf      = new HoneywellPBParser().LoadFile(ROOTDIR + "NPUpld-20200930-005900M_MTL.txt", "CP01", DateTime.Now);

            pf.SaveRecords();
            string json = pf.ExportR2PJson();

            pf.RecordSuccess("sampleHoneyPB.xlsx");
        }
Beispiel #5
0
        public void Test1()
        {
            HoneywellPBFile pf = new HoneywellPBParser().LoadFile(ROOTDIR + "NPUpld-20200928-005900M.txt", "CP01", DateTime.Now);

            Assert.IsTrue(pf.Values.ContainsKey("ACCOUNT_DATE"));
            Assert.IsTrue(pf.Values.ContainsKey("REFINERY_GAIN_LOSS"));
            Assert.IsTrue(pf.Defaults.ContainsKey("DATEFORMAT"));
            Assert.IsTrue(pf.BalanceRecords[0].Values.ContainsKey("BALANCE_GROUP_NAME"));
            Assert.IsTrue(pf.BalanceRecords[0].ProductionRecords.Count > 0);
//            Assert.IsTrue(pf.BalanceRecords[0].ProductionRecords.Count == 38);
            foreach (var pr in pf.BalanceRecords[0].ProductionRecords)
            {
                decimal netYield = pr.GetDecimalValue("NET_YIELD");
                decimal AMMDT    = pr.GetAMMDTQuantity();
            }
        }