Exemplo n.º 1
0
        public void NewThread_Can_Not_Remove_Multiple_Threads_Should_Throw_NotSupportedException()
        {
            // Arrange
            Forum forum = new Forum();

            DateTime     currentDateTime = DateTime.Now;
            Person       person          = new Person("Bas", ERole.Lead);
            Task         task            = new Task("Sample Task", person);
            const string threadOneName   = "ThreadOne title.";
            const string threadTwoName   = "ThreadTwo title.";

            Thread threadOne = new Thread(threadOneName, currentDateTime, person, task);
            Thread threadTwo = new Thread(threadTwoName, currentDateTime, person, task);

            // Act

            // Assert
            Assert.Throws <NotSupportedException>(() => forum.ArchiveThread(threadOne));
            Assert.Throws <NotSupportedException>(() => forum.ArchiveThread(threadTwo));
            Assert.DoesNotContain(threadOne, forum.GetThreads());
            Assert.DoesNotContain(threadTwo, forum.GetThreads());
        }
Exemplo n.º 2
0
        public void NewThread_Can_Remove_Thread()
        {
            // Arrange
            Forum forum = new Forum();

            DateTime     currentDateTime = DateTime.Now;
            Person       person          = new Person("Bas", ERole.Lead);
            Task         task            = new Task("Sample Task", person);
            const string threadOneName   = "ThreadOne title.";

            Thread threadOne = new Thread(threadOneName, currentDateTime, person, task);

            // Act
            forum.NewThread(threadOne);
            forum.ArchiveThread(threadOne);

            // Assert
            Assert.DoesNotContain(threadOne, forum.GetThreads());
        }