public void InsertTest() { //Load up Guids PieceList pieces = new PieceList(); Piece piece = new Piece(); pieces.Load(); piece = pieces.FirstOrDefault(p => p.Name == "Rock Music"); ComposerList composers = new ComposerList(); Composer composer = new Composer(); composers.Load(); composer = composers.FirstOrDefault(c => c.FirstName == "Modest"); ComposerTypeList ctl = new ComposerTypeList(); ComposerType ct = new ComposerType(); ctl.Load(); ct = ctl.FirstOrDefault(c => c.Description == "Arranger"); PieceWriter pieceWriter = new PieceWriter(); pieceWriter.ComposerId = composer.Id; pieceWriter.PieceId = piece.Id; pieceWriter.ComposerTypeId = ct.Id; int results = pieceWriter.Insert(); Assert.IsTrue(results == 1); }
// POST: api/PieceWriter public void Post(PieceWriter pieceWriter) { pieceWriter.Insert(); }