public void SGSPDPutTest_7_mess()
        {
            var res = new List <SGSPointData>();

            res.Add(new SGSPointData {
                IdSGSPoint   = 1,
                PointValue   = 226.782165527343,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 0, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = 1,
                PointValue   = 213.99836730957,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 1, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = 1,
                PointValue   = 214.845962524413,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 2, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = 1,
                PointValue   = 220.641265869141,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 9, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = 1,
                PointValue   = 219.261199951172,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 12, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = 1,
                PointValue   = 215.261199951172,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 14, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = 1,
                PointValue   = 210.261199951172,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 15, 0),
                Explantation = "added on unit test"
            });
            var resm = SGSPointData.Put(res);

            Assert.AreEqual(7, res.Count);
            foreach (var m in resm)
            {
                Console.WriteLine($"{{\"MNumber\":{m.MNumber}, \"MessadgeString\": \"{m.MessadgeString}\"");
            }
        }
Example #2
0
 public List <Messadge> Put([FromBody] IEnumerable <SGSPointData> SGSPointDatas)
 {
     return(SGSPointData.Put(SGSPointDatas));
 }
        public void SGSPDPutTest_7_messTroubleShot()
        {
            var res = new List <SGSPointData>();
            var idp = 5;

            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 11.0920066833496,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 0, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 9.23535823822021,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 1, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 10.4018611907959,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 2, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 11.5134706497192,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 3, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 10.34092617,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 4, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 10.64092617,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 5, 0),
                Explantation = "added on unit test"
            });
            res.Add(new SGSPointData
            {
                IdSGSPoint   = idp,
                PointValue   = 10.85793114,
                DateOfValue  = new DateTime(2020, 4, 1, 0, 6, 0),
                Explantation = "added on unit test"
            });
            var resm = SGSPointData.Put(res);

            Assert.AreEqual(7, res.Count);
            var point = SGSPoint.GetAll.Where(m => m.Id == idp).FirstOrDefault();

            Assert.AreEqual(res[6].DateOfValue, point.LastDTSafeValue);
            foreach (var m in resm)
            {
                Console.WriteLine($"{{\"MNumber\":{m.MNumber}, \"MessadgeString\": \"{m.MessadgeString}\"");
            }
        }