Esempio n. 1
0
        public void ControllerRaisesDetectEvent()
        {
            List <string> tags = new List <string>();

            tags.Add("T1");
            Event        e      = new Event(DateTime.Now, "entered area", "Notification", tags);
            List <Event> events = new List <Event>();

            events.Add(e);


            EventEventArgs _eResults = new EventEventArgs()
            {
                Events = events
            };

            //Fake listener
            _uut.DetectEvent += (sender, output2) => _eResults = output2;


            _eventdetector.DetectEvents(t).Returns(events);

            // Raise Event
            _relay.RelayEvent += Raise.EventWith(this, args);

            // Assertions
            Assert.That(_eResults.Events.Count.Equals(1));
        }
Esempio n. 2
0
        private void RelayEventHandler(object sender, TrackEventArgs e)
        {
            tracks = e.Tracks;
            tracks = _compassCourse.CalcCourse(tracks);
            tracks = _area.CheckArea(tracks);
            tracks = _speed.CalcSpeed(tracks);
            tracks = _conflict.DetectConflict(tracks);


            ControllerEvent(this, new TrackEventArgs()
            {
                Tracks = tracks
            });

            events = _eventDetector.DetectEvents(tracks);


            if (events != null && events.Count > 0)
            {
                DetectEvent(this, new EventEventArgs()
                {
                    Events = events
                });
            }
        }
Esempio n. 3
0
        public void SUTFileLogReceivesEvents()
        {
            List <Event> events1 = new List <Event>();
            List <Track> tracks1 = new List <Track>();

            Track track1 = new Track();

            track1.Tag    = "AB408";
            track1.InArea = false;
            tracks1.Add(track1);
            events1 = _sut.DetectEvents(tracks1);

            List <Track> tracks2 = new List <Track>();
            Track        track2  = new Track();

            track2.Tag    = "AB408";
            track2.InArea = true;
            tracks2.Add(track2);
            events1 = _sut.DetectEvents(tracks2);

            _fileLog.Received().Log(events1);
        }
Esempio n. 4
0
        public void UutConflictEventNotDetected()
        {
            List <Event> events1 = new List <Event>();

            List <Track> tracks1 = new List <Track>();
            Track        track1  = new Track();

            track1.Tag = "AB408";
            tracks1.Add(track1);
            events1 = _uut.DetectEvents(tracks1);

            List <Track> tracks2 = new List <Track>();
            Track        track2  = new Track();

            track2.Tag = "AB408";
            tracks2.Add(track2);
            events1 = _uut.DetectEvents(tracks2);

            Assert.That(events1.Count > 0, Is.EqualTo(false));
        }