예제 #1
0
        public void CreateBackgroundThread_CreateThread_CheckIfItRuns()
        {
            // Arrange
            var logger = new Mock <Logger>();
            var ts     = new ThreadService(logger.Object);

            new Thread(() =>
            {
                Thread.CurrentThread.IsBackground = true;
            }).Start();

            // Act
            ts.CreateBackgroundThread();


            // Assert
            Assert.IsTrue((Thread.CurrentThread.ThreadState & ThreadState.WaitSleepJoin) != 0);
        }
예제 #2
0
 public void StartLogger()
 {
     _threadService.CreateBackgroundThread();
 }