public OfferApiObject OfferApiObject(bool test)
 {
     OfferApiObject offer = new OfferApiObject();
     offer.TestOffer = test;
     offer.OfferID = new Guid();
     offer.Title = "Xunit Offer";
     return offer;
 }
 public static void OfferObjectToOfferApiObject(List<OfferObject> offersToConvert, bool Test)
 {
     var convertedOffersApiObjects = new List<OfferApiObject>();
     foreach (var offerToConvert in offersToConvert)
     {
         if (offerToConvert.Status == 1 && offerToConvert.TestOffer == Test)
         {
             OfferApiObject convertedOfferApiObject = new OfferApiObject();
             convertedOfferApiObject.CPI = (offerToConvert.Terms != null && offerToConvert.Terms.Count > 0) ? offerToConvert.Terms.FindLast(i => i.Active == true).CPI : 0;
             convertedOfferApiObject.Description = offerToConvert.Description;
             convertedOfferApiObject.IR = offerToConvert.IR;
             convertedOfferApiObject.LOI = offerToConvert.LOI;
             convertedOfferApiObject.OfferID = offerToConvert.Id;
             convertedOfferApiObject.OfferLink = offerToConvert.OfferLink;
             convertedOfferApiObject.QuotaRemaining = offerToConvert.QuotaRemaining;
             convertedOfferApiObject.TermID = (offerToConvert.Terms != null && offerToConvert.Terms.Count > 0) ? offerToConvert.Terms.FindLast(i => i.Active == true).Id : new Guid();
             convertedOfferApiObject.TestOffer = (bool)offerToConvert.TestOffer;
             convertedOfferApiObject.Title = offerToConvert.Title;
             convertedOfferApiObject.Topic = offerToConvert.Topic;
             convertedOffersApiObjects.Add(convertedOfferApiObject);
             IOfferRepository.Setup(i => i.SelectByID(offerToConvert.Id)).Returns(offerToConvert);
         }
     }
     IOfferRepository.Setup(i => i.GetActiveOffersHavingValidTerm(Test)).Returns(convertedOffersApiObjects);
 }