public void Insert()
        {
            //Setup
            ComposerList cl       = new ComposerList();
            Composer     composer = new Composer();

            cl.Load();
            composer = cl.FirstOrDefault(c => c.FirstName == "Alex");

            PieceList pl    = new PieceList();
            Piece     piece = new Piece();

            pl.Load();
            piece = pl.FirstOrDefault(p => p.Name == "Pictures At An Exhibition");

            ComposerTypeList ctl          = new ComposerTypeList();
            ComposerType     composerType = new ComposerType();

            ctl.Load();
            composerType = ctl.FirstOrDefault(ct => ct.Description == "Composer");



            PieceWriter pieceWriter = new PieceWriter
            {
                ComposerId     = composer.Id,
                ComposerTypeId = composerType.Id,
                PieceId        = piece.Id
            };
            PieceWriterList pieceWriters = new PieceWriterList();

            pieceWriters.Load();
            int originalCount = pieceWriters.Count();



            //Act
            HttpClient client = InitializeClient();
            //Serialize a pieceWriter object that we're trying to insert
            string serializedPieceWriter = JsonConvert.SerializeObject(pieceWriter);
            var    content = new StringContent(serializedPieceWriter);

            content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
            HttpResponseMessage response = client.PostAsync("PieceWriter", content).Result;

            //Assert
            pieceWriters.Clear();
            pieceWriters.Load();
            Assert.AreEqual(originalCount + 1, pieceWriters.Count);
        }
        public void Delete()
        {
            //Setup
            ComposerList cl       = new ComposerList();
            Composer     composer = new Composer();

            cl.Load();
            composer = cl.FirstOrDefault(c => c.FirstName == "Alex");

            PieceList pl    = new PieceList();
            Piece     piece = new Piece();

            pl.Load();
            piece = pl.FirstOrDefault(p => p.Name == "Pictures At An Exhibition");

            ComposerTypeList ctl      = new ComposerTypeList();
            ComposerType     arranger = new ComposerType();

            ctl.Load();
            arranger = ctl.FirstOrDefault(ct => ct.Description == "Arranger");

            PieceWriterList pieceWriters = new PieceWriterList();

            pieceWriters.Load();
            int originalCount = pieceWriters.Count();

            PieceWriter pieceWriter = pieceWriters.FirstOrDefault(pw => pw.ComposerId == composer.Id && pw.ComposerTypeId == arranger.Id && pw.PieceId == piece.Id);

            //Act
            if (pieceWriter != null)
            {
                HttpClient          client   = InitializeClient();
                HttpResponseMessage response = client.DeleteAsync("PieceWriter/" + pieceWriter.Id).Result;
            }

            //Assert
            pieceWriters.Clear();
            pieceWriters.Load();
            Assert.AreEqual(originalCount - 1, pieceWriters.Count);
        }