public void DrogueRunPosition_Controller_Put_Test()
        {
            foreach (LanguageEnum LanguageRequest in AllowableLanguages)
            {
                foreach (int ContactID in new List <int>()
                {
                    AdminContactID
                })                                                             //, TestEmailValidatedContactID, TestEmailNotValidatedContactID })
                {
                    DrogueRunPositionController drogueRunPositionController = new DrogueRunPositionController(DatabaseTypeEnum.SqlServerTestDB);
                    Assert.IsNotNull(drogueRunPositionController);
                    Assert.AreEqual(DatabaseTypeEnum.SqlServerTestDB, drogueRunPositionController.DatabaseType);

                    DrogueRunPosition drogueRunPositionLast = new DrogueRunPosition();
                    using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
                    {
                        Query query = new Query();
                        query.Language = LanguageRequest;

                        DrogueRunPositionService drogueRunPositionService = new DrogueRunPositionService(query, db, ContactID);
                        drogueRunPositionLast = (from c in db.DrogueRunPositions select c).FirstOrDefault();
                    }

                    // ok with DrogueRunPosition info
                    IHttpActionResult jsonRet = drogueRunPositionController.GetDrogueRunPositionWithID(drogueRunPositionLast.DrogueRunPositionID);
                    Assert.IsNotNull(jsonRet);

                    OkNegotiatedContentResult <DrogueRunPosition> Ret = jsonRet as OkNegotiatedContentResult <DrogueRunPosition>;
                    DrogueRunPosition drogueRunPositionRet            = Ret.Content;
                    Assert.AreEqual(drogueRunPositionLast.DrogueRunPositionID, drogueRunPositionRet.DrogueRunPositionID);

                    BadRequestErrorMessageResult badRequest = jsonRet as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest);

                    // Put to return success
                    IHttpActionResult jsonRet2 = drogueRunPositionController.Put(drogueRunPositionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet2);

                    OkNegotiatedContentResult <DrogueRunPosition> drogueRunPositionRet2 = jsonRet2 as OkNegotiatedContentResult <DrogueRunPosition>;
                    Assert.IsNotNull(drogueRunPositionRet2);

                    BadRequestErrorMessageResult badRequest2 = jsonRet2 as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest2);

                    // Put to return CSSPError because DrogueRunPositionID of 0 does not exist
                    drogueRunPositionRet.DrogueRunPositionID = 0;
                    IHttpActionResult jsonRet3 = drogueRunPositionController.Put(drogueRunPositionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet3);

                    OkNegotiatedContentResult <DrogueRunPosition> drogueRunPositionRet3 = jsonRet3 as OkNegotiatedContentResult <DrogueRunPosition>;
                    Assert.IsNull(drogueRunPositionRet3);

                    BadRequestErrorMessageResult badRequest3 = jsonRet3 as BadRequestErrorMessageResult;
                    Assert.IsNotNull(badRequest3);
                }
            }
        }
        public void DrogueRunPosition_Controller_GetDrogueRunPositionWithID_Test()
        {
            foreach (LanguageEnum LanguageRequest in AllowableLanguages)
            {
                foreach (int ContactID in new List <int>()
                {
                    AdminContactID
                })                                                             //, TestEmailValidatedContactID, TestEmailNotValidatedContactID })
                {
                    DrogueRunPositionController drogueRunPositionController = new DrogueRunPositionController(DatabaseTypeEnum.SqlServerTestDB);
                    Assert.IsNotNull(drogueRunPositionController);
                    Assert.AreEqual(DatabaseTypeEnum.SqlServerTestDB, drogueRunPositionController.DatabaseType);

                    DrogueRunPosition drogueRunPositionFirst = new DrogueRunPosition();
                    using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
                    {
                        DrogueRunPositionService drogueRunPositionService = new DrogueRunPositionService(new Query(), db, ContactID);
                        drogueRunPositionFirst = (from c in db.DrogueRunPositions select c).FirstOrDefault();
                    }

                    // ok with DrogueRunPosition info
                    IHttpActionResult jsonRet = drogueRunPositionController.GetDrogueRunPositionWithID(drogueRunPositionFirst.DrogueRunPositionID);
                    Assert.IsNotNull(jsonRet);

                    OkNegotiatedContentResult <DrogueRunPosition> Ret = jsonRet as OkNegotiatedContentResult <DrogueRunPosition>;
                    DrogueRunPosition drogueRunPositionRet            = Ret.Content;
                    Assert.AreEqual(drogueRunPositionFirst.DrogueRunPositionID, drogueRunPositionRet.DrogueRunPositionID);

                    BadRequestErrorMessageResult badRequest = jsonRet as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest);

                    // Not Found
                    IHttpActionResult jsonRet2 = drogueRunPositionController.GetDrogueRunPositionWithID(0);
                    Assert.IsNotNull(jsonRet2);

                    OkNegotiatedContentResult <DrogueRunPosition> drogueRunPositionRet2 = jsonRet2 as OkNegotiatedContentResult <DrogueRunPosition>;
                    Assert.IsNull(drogueRunPositionRet2);

                    NotFoundResult notFoundRequest = jsonRet2 as NotFoundResult;
                    Assert.IsNotNull(notFoundRequest);
                }
            }
        }
        public void DrogueRunPosition_Controller_Post_Test()
        {
            foreach (LanguageEnum LanguageRequest in AllowableLanguages)
            {
                foreach (int ContactID in new List <int>()
                {
                    AdminContactID
                })                                                             //, TestEmailValidatedContactID, TestEmailNotValidatedContactID })
                {
                    DrogueRunPositionController drogueRunPositionController = new DrogueRunPositionController(DatabaseTypeEnum.SqlServerTestDB);
                    Assert.IsNotNull(drogueRunPositionController);
                    Assert.AreEqual(DatabaseTypeEnum.SqlServerTestDB, drogueRunPositionController.DatabaseType);

                    DrogueRunPosition drogueRunPositionLast = new DrogueRunPosition();
                    using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
                    {
                        Query query = new Query();
                        query.Language = LanguageRequest;
                        query.Asc      = "";
                        query.Desc     = "";

                        DrogueRunPositionService drogueRunPositionService = new DrogueRunPositionService(query, db, ContactID);
                        drogueRunPositionLast = (from c in db.DrogueRunPositions select c).FirstOrDefault();
                    }

                    // ok with DrogueRunPosition info
                    IHttpActionResult jsonRet = drogueRunPositionController.GetDrogueRunPositionWithID(drogueRunPositionLast.DrogueRunPositionID);
                    Assert.IsNotNull(jsonRet);

                    OkNegotiatedContentResult <DrogueRunPosition> Ret = jsonRet as OkNegotiatedContentResult <DrogueRunPosition>;
                    DrogueRunPosition drogueRunPositionRet            = Ret.Content;
                    Assert.AreEqual(drogueRunPositionLast.DrogueRunPositionID, drogueRunPositionRet.DrogueRunPositionID);

                    BadRequestErrorMessageResult badRequest = jsonRet as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest);

                    // Post to return CSSPError because DrogueRunPositionID exist
                    IHttpActionResult jsonRet2 = drogueRunPositionController.Post(drogueRunPositionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet2);

                    OkNegotiatedContentResult <DrogueRunPosition> drogueRunPositionRet2 = jsonRet2 as OkNegotiatedContentResult <DrogueRunPosition>;
                    Assert.IsNull(drogueRunPositionRet2);

                    BadRequestErrorMessageResult badRequest2 = jsonRet2 as BadRequestErrorMessageResult;
                    Assert.IsNotNull(badRequest2);

                    // Post to return newly added DrogueRunPosition
                    drogueRunPositionRet.DrogueRunPositionID       = 0;
                    drogueRunPositionController.Request            = new System.Net.Http.HttpRequestMessage();
                    drogueRunPositionController.Request.RequestUri = new System.Uri("http://localhost:5000/api/drogueRunPosition");
                    IHttpActionResult jsonRet3 = drogueRunPositionController.Post(drogueRunPositionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet3);

                    CreatedNegotiatedContentResult <DrogueRunPosition> drogueRunPositionRet3 = jsonRet3 as CreatedNegotiatedContentResult <DrogueRunPosition>;
                    Assert.IsNotNull(drogueRunPositionRet3);

                    BadRequestErrorMessageResult badRequest3 = jsonRet3 as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest3);

                    IHttpActionResult jsonRet4 = drogueRunPositionController.Delete(drogueRunPositionRet, LanguageRequest.ToString());
                    Assert.IsNotNull(jsonRet4);

                    OkNegotiatedContentResult <DrogueRunPosition> drogueRunPositionRet4 = jsonRet4 as OkNegotiatedContentResult <DrogueRunPosition>;
                    Assert.IsNotNull(drogueRunPositionRet4);

                    BadRequestErrorMessageResult badRequest4 = jsonRet4 as BadRequestErrorMessageResult;
                    Assert.IsNull(badRequest4);
                }
            }
        }