예제 #1
0
        public void GetDeleteAlbumsByArtistSqlExceptionTest()
        {
            var value = new IdentifyingInfo
            {
                Id = null
            };

            var parameters = new List <SQLiteParameter>();
            var table      = new ArtistTable();

            Assert.That(() => table.GetDeleteAlbumsByArtistSql(value, ref parameters), Throws.ArgumentException);
        }
예제 #2
0
        public void GetDeleteAlbumsByArtistSqlTest()
        {
            var id    = HelperObjectFactory.GetRandomInt(0, 100);
            var value = new IdentifyingInfo
            {
                Id = id
            };

            var parameters = new List <SQLiteParameter>();
            var table      = new ArtistTable();
            var expected   = $"DELETE FROM {TableFactory<Album>.GetTable<AlbumTable>().TableName} WHERE {AlbumTable.ArtistIdColumnName} = @{AlbumTable.ArtistIdColumnName};";

            Assert.AreEqual(expected, table.GetDeleteAlbumsByArtistSql(value, ref parameters));
            Assert.AreEqual(1, parameters.Count);
        }