Beispiel #1
0
        public void PrepareCourses_WhenCalled_ChangesAllCoursesStringArray()
        {
            IPrepareCoursesForInput prepareCoursesForInput = Substitute.For <IPrepareCoursesForInput>();

            string[] testCourses = { "Intro to Arguing on the Internet: Godwin’s Law",
                                     "Understanding Circular Logic: Intro to Arguing on the Internet" };

            prepareCoursesForInput.When(p => p.PrepareCourses(testCourses)).Do(context => { throw new Exception("fake exception"); });

            Assert.Throws <Exception>(() => prepareCoursesForInput.PrepareCourses(testCourses));
        }