public IHttpActionResult PutReleaseFeature(int id, ReleaseFeature releaseFeature)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != releaseFeature.ReleaseFeatureId)
            {
                return(BadRequest());
            }

            db.Entry(releaseFeature).State = EntityState.Modified;

            try {
                db.SaveChanges();
            } catch (DbUpdateConcurrencyException) {
                if (!ReleaseFeatureExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetReleaseFeature(int id)
        {
            ReleaseFeature releaseFeature = db.ReleaseFeatures.Find(id);

            if (releaseFeature == null)
            {
                return(NotFound());
            }

            return(Ok(releaseFeature));
        }
        public IHttpActionResult PostReleaseFeature(ReleaseFeature releaseFeature)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ReleaseFeatures.Add(releaseFeature);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = releaseFeature.ReleaseFeatureId }, releaseFeature));
        }
        public IHttpActionResult DeleteReleaseFeature(int id)
        {
            ReleaseFeature releaseFeature = db.ReleaseFeatures.Find(id);

            if (releaseFeature == null)
            {
                return(NotFound());
            }

            db.ReleaseFeatures.Remove(releaseFeature);
            db.SaveChanges();

            return(Ok(releaseFeature));
        }
        public void assign_feature_to_release()
        {
            //Arrange
            var model = new ReleaseFeature {
                FeatureId  = 1,
                ReleaseId  = 1,
                StatusCode = "new"
            };

            var controller = new ReleaseFeaturesController();

            //Act
            var response = controller.PostReleaseFeature(model) as CreatedAtRouteNegotiatedContentResult <ReleaseFeature>;;

            //Assert
            Assert.IsNotNull(response);
            var releaseFeature = response.Content;

            Assert.IsTrue(releaseFeature.ReleaseFeatureId > 0);


            Assert.AreEqual(model.ReleaseId, releaseFeature.ReleaseId);
            Assert.AreEqual(model.FeatureId, releaseFeature.FeatureId);
        }