public void TestSuccessfulDatabaseWrite() { var redboxMovies = new List <RedboxMovie>() { new RedboxMovie(SuccessfulId, "0") }; var writer = new RedBoxDatabaseWriter(redboxMovies); writer.WriteAllMovies(); Assert.AreEqual(1, GetRecordCountById(SuccessfulId, writer.Connection)); }
public void DatabaseWriteError() { var movies = new List <RedboxMovie>() { new RedboxMovie("This title id is too long", "1") }; var writer = new RedBoxDatabaseWriter(movies); writer.Connect(); Assert.Throws <DatabaseWritingException>(() => writer.WriteAllMovies()); writer.Connection.Close(); }