Exemplo n.º 1
0
        /// <summary>
        /// Setup the library
        /// </summary>
        static Storage()
        {
            // DatabaseFile = Path.GetTempFileName();
            DatabaseFile = "c:/temp/movies.db";

            Instance = new SimpleMediaLibrary(new NHMediaLibraryStorage(DatabaseFile));
        }
        public void Before_Each_Test()
        {
            _critic = MockRepository.GenerateMock<IMovieCritic>();

            // By default a dynamic mock returns false
            _movie1 = MockRepository.GenerateMock<IMovie>();
            _movie2 = MockRepository.GenerateMock<IMovie>();
            _movie3 = MockRepository.GenerateMock<IMovie>();

            _sut = new SimpleMediaLibrary(_critic);
        }
        public void When_ListingNV_Should_Throw_Exception_If_Missing_Critic()
        {
            // Create the library without critic
            _sut = new SimpleMediaLibrary(null);

            Assert.Throws<MissingCriticException>(() => _sut.ListNonViolent(), "Critic Exception");
        }