Exemple #1
0
        public void WhenBeginAndEndDeferredEventsDontMatchUp_HandleDeferredEventsStream_ThrowsException()
        {
            BuildLog      log        = new BuildLog();
            DeferredEvent startEvent = new DeferredEvent()
            {
                Type = DeferredEventType.Begin
            };
            List <DeferredEvent> events = new List <DeferredEvent>()
            {
                startEvent
            };

            Assert.Throws <Exception>(() => log.HandleDeferredEventStreamInternal(events));
        }
Exemple #2
0
        public void WhenDeferredEventsAreOnlyInfoTypes_HandleDeferredEventsStream_CreatesLogEntry()
        {
            BuildLog      log       = new BuildLog();
            DeferredEvent infoEvent = new DeferredEvent()
            {
                Name = "Info", Type = DeferredEventType.Info
            };
            List <DeferredEvent> events = new List <DeferredEvent>()
            {
                infoEvent
            };

            log.HandleDeferredEventStreamInternal(events);
            Assert.AreEqual(infoEvent.Name, log.Root.Entries[0].Message);
        }
Exemple #3
0
        public void WhenBeginAndEndDeferredEventsMatchUp_HandleDeferredEventsStream_CreatesLogEvents()
        {
            BuildLog      log        = new BuildLog();
            DeferredEvent startEvent = new DeferredEvent()
            {
                Name = "Start", Type = DeferredEventType.Begin
            };
            DeferredEvent endEvent = new DeferredEvent()
            {
                Name = "End", Type = DeferredEventType.End
            };
            List <DeferredEvent> events = new List <DeferredEvent>()
            {
                startEvent, endEvent
            };

            log.HandleDeferredEventStreamInternal(events);
            Assert.AreEqual(startEvent.Name, log.Root.Children[0].Name);
        }