コード例 #1
0
        public async Task ReadCSV_WhenCalled_CorrectStartTime()
        {
            FakeReader   reader = new FakeReader();
            FileIO       iO     = new FileIO();
            DataProvider data   = new DataProvider();
            var          read   = NSubstitute.Substitute.For <IReader>();

            await iO.ReadCSV(data, "", reader, Factories.GetMainWindowViewModelStub());

            Assert.AreEqual(new DateTime(2019, 08, 26), data.RouteDate);
        }
コード例 #2
0
        public async Task ReadNmea_WhenCalled_CorrectSattelitesInUse()
        {
            FakeReader   reader = new FakeReader();
            FileIO       iO     = new FileIO();
            DataProvider data   = new DataProvider();


            await iO.ReadNmea(data, "", reader, Factories.GetMainWindowViewModelStub());

            Assert.AreEqual(12, data.AverageSattelitesInUse);
        }
コード例 #3
0
        public async Task ReadCSV_WhenCalled_CorrectHeight()
        {
            FakeReader   reader = new FakeReader();
            FileIO       iO     = new FileIO();
            DataProvider data   = new DataProvider();
            var          read   = NSubstitute.Substitute.For <IReader>();

            await iO.ReadCSV(data, "", reader, Factories.GetMainWindowViewModelStub());

            List <float> vs = new List <float>();

            vs.Add(509);

            Assert.AreEqual(vs, data.Height);
        }
コード例 #4
0
        public async Task ReadCSV_WhenCalled_CorrectVelocity()
        {
            FakeReader   reader = new FakeReader();
            FileIO       iO     = new FileIO();
            DataProvider data   = new DataProvider();
            var          read   = NSubstitute.Substitute.For <IReader>();

            List <float> x = new List <float>();
            List <float> y = new List <float>();
            List <float> z = new List <float>();

            x.Add(66);
            y.Add(61);
            z.Add(98);

            await iO.ReadNmea(data, "", reader, Factories.GetMainWindowViewModelStub());
        }
コード例 #5
0
        public async Task ReadNmea_WhenCalled_CorrectTime()
        {
            FakeReader   reader = new FakeReader();
            FileIO       iO     = new FileIO();
            DataProvider data   = new DataProvider();
            var          read   = NSubstitute.Substitute.For <IReader>();

            await iO.ReadNmea(data, "", reader, Factories.GetMainWindowViewModelStub());

            DateTime dateTime = DateTime.Today;

            dateTime = dateTime.AddHours(09);
            dateTime = dateTime.AddMinutes(11);
            dateTime = dateTime.AddSeconds(24);

            Assert.AreEqual(dateTime, data.RouteStartTime);
            Assert.AreEqual(dateTime, data.RouteEndTime);
        }
コード例 #6
0
        public async Task ReadCSV_WhenCalled_CorrectAcceleration()
        {
            FakeReader   reader = new FakeReader();
            FileIO       iO     = new FileIO();
            DataProvider data   = new DataProvider();
            var          read   = NSubstitute.Substitute.For <IReader>();

            List <float> x = new List <float>();
            List <float> y = new List <float>();
            List <float> z = new List <float>();

            x.Add(66);
            y.Add(61);
            z.Add(98);

            await iO.ReadCSV(data, "", reader, Factories.GetMainWindowViewModelStub());

            Assert.AreEqual(y, data.YAcceleration);
            Assert.AreEqual(z, data.ZAcceleration);
            Assert.AreEqual(x, data.XAcceleration);
        }