lundi 28 septembre 2015

Unit testing, OxyPlot data point comparation

I want to compare a data point received from a postgres database with the data pointer that i have send to the database.

[TestMethod]
        public void MeasurementWriteReadDelete()
        {
            Measurement core = new Measurement();

            DbRepository database = null;


            database = DbRepository.GetInstance();
            database.EstablishConnection("postgres", "1234");
            Assert.IsTrue(database.IsConnected);

            core.Title = "aaa";
            core.Description = "bbb";
            core.Tester = "1.22";
            core.ForceTravelCharacteristic.Points.Add(new DataPoint(0, 2));
            core.PullForceCharacteristic.Points.Add(new DataPoint(0, 4));
            core.ReturnSpeedCharacteristic.Points.Add(new DataPoint(1, 1));
            core.EngagementPoint.X = 10;
            core.EngagementPoint.Y = 13;
            core.CreateInDatabase(DbRepository.GetInstance());
            core.Id = Convert.ToUInt32(core.CurrentID);

            core.ReadCharacteristicFromDatabase(DbRepository.GetInstance());

            core.ReadMetadataFromDatabase(DbRepository.GetInstance());



            Assert.AreEqual("aaa", core.Title);
            Assert.AreEqual("bbb", core.Description);
            Assert.AreEqual("1.22", core.Tester);
            Assert.AreEqual(10, core.EngagementPoint.X);
            Assert.AreEqual(13, core.EngagementPoint.Y);


            Assert.AreEqual(  , core.ForceTravelCharacteristic);

            core.DeleteFromDatabase(DbRepository.GetInstance());

I want to compare this:

core.ForceTravelCharacteristic.Points.Add(new DataPoint(0, 2));

with the data from database:

core.ForceTravelCharacteristic

How can i do this comparison?

Aucun commentaire:

Enregistrer un commentaire