Пример #1
0
        public void Update_VelocityOldandNew_returnsNotEqual()
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            _track1.TimeStamp.Returns(new DateTime(2018, 05, 13, 10, 50, 30));
            _track1.X.Returns(58000);
            _track1.Y.Returns(67000);
            _track1.Tag.Returns("SHN63");


            _trackData.Add(_track1);

            uut.Update(_trackData);         //new list SHN63 og old list SHN63

            // _trackData.Clear();

            _track2.TimeStamp.Returns(new DateTime(2018, 05, 13, 10, 50, 36));
            _track2.X.Returns(65000);
            _track2.Y.Returns(71000);
            _track2.Tag.Returns("SHN63");



            _trackData.Add(_track2);
            var vel = new TrackUpdate(_trackRendition, _proximityDetection).CalVelocity(_track1, _track2);

            uut.Update(_trackData);

            Assert.AreNotEqual(vel, uut.oldList[0].Velocity);
        }
Пример #2
0
        public void ProximityDetection_IsCalled_True()
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            uut.Update(_trackData);

            _proximityDetection.Received().CheckProximityDetection(_trackData);
        }
Пример #3
0
        public void Update_VelocityOldandNew_returnsEqual()
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            _trackData.Add(_track1);
            _trackData.Add(_track2);

            uut.Update(_trackData);                     //new list
            Assert.That(_trackData[0].Velocity, Is.EqualTo(uut.oldList[0].Velocity));
        }
Пример #4
0
        public void Update_TimeStampOldandNew_returnsNotEqual()
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            _trackData.Add(_track1);
            _trackData.Add(_track2);

            uut.Update(_trackData);
            Assert.AreNotEqual(_trackData[1].TimeStamp, uut.oldList[0].TimeStamp);
        }
Пример #5
0
        public void Update_TimeStampOldandNew_returnsEqual()
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            _trackData.Add(_track1);
            _trackData.Add(_track2);

            uut.Update(_trackData);                                                     //new list
            Assert.That(_trackData[0].TimeStamp, Is.EqualTo(uut.oldList[0].TimeStamp)); //New list is equal to oldList
        }
Пример #6
0
        public void CalCourse_CalculateTrack1andTrack2_Returns(int x1, int x2, int y1, int y2, int result)
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            _track1.X.Returns(x1);
            _track2.X.Returns(x2);
            _track1.Y.Returns(y1);
            _track2.Y.Returns(y2);
            _trackData.Add(_track1);
            _trackData.Add(_track2);
            Assert.That(uut.CalCourse(_track1, _track2), Is.EqualTo(result));
        }
Пример #7
0
        public void CalVelocity_CalculateTrack1andTrack2_ReturnsVelocity(int x1, int x2, int y1, int y2, int result) //WORKS
        {
            var uut = new TrackUpdate(_trackRendition, _proximityDetection);

            _track1.TimeStamp.Returns(new DateTime(2018, 05, 13, 10, 50, 35));
            _track2.TimeStamp.Returns(new DateTime(2018, 05, 13, 10, 50, 36));
            _track1.X.Returns(x1);
            _track2.X.Returns(x2);
            _track1.Y.Returns(y1);
            _track2.Y.Returns(y2);

            _trackData.Add(_track1);
            _trackData.Add(_track2);

            Assert.That(uut.CalVelocity(_track1, _track2), Is.EqualTo(result));
        }
        public void Can_serialize_TrackUpdate()
        {
            var dto = new TrackUpdate {
                Delete = false,
                ExternalRef = "00028946767825/gbbbb2014307",
                ExternalUrn = "urn:track:universal:00028946767825/gbbbb2014307",
                SupplierKeyName = "universal",
                Name = "Act 3 [Rigoletto} - Lili Marlene",
                NameExVersion = "Act 3 [Rigoletto} - Lili Marlene",
                LabelText = "Decca",
                ArtistText = "La Scala [Ensemble]",
                ReleaseText = "Captain Corelli's Mandolin -Original Motion Picture Soundtrack",
                Isrc = "GBBBB2014307",
                DiscNumber = 1,
                TrackNumber=7,
                DurationMs = 188000,
                ExplicitType = ExplicitType.Unknown,
                Copyright = "Copyright:2001 Decca Music Group Limited",
                Genres = new List<string> { "Classical" },
            };

            Serialize(dto);
        }