public static PromotionDto.PromotionDataTable WithRow(this PromotionDto.PromotionDataTable table, int promotionId, string name, string promotionType,
                                                              int campaignId, Guid applicationId = default(Guid), string status = "active",
                                                              DateTime?startDate     = null,
                                                              DateTime?endDate       = null, string couponCode        = "", decimal offerAmount    = 20, int offerType       = 1,
                                                              string exclusivityType = "none", int priority           = 1, DateTime?created        = null, DateTime?modified = null,
                                                              string modifiedBy      = "admin", string promotionGroup = "entry", int perOrderLimit = 0,
                                                              int applicationLimit   = 0, XDocument settingsXml       = null, int customerLimit    = 0)
        {
            var row = table.NewPromotionRow();

            row.ApplicationId    = applicationId == default(Guid) ? ApplicationId : applicationId;
            row.ApplicationLimit = applicationLimit;
            row.CampaignId       = campaignId;
            row.CouponCode       = couponCode;
            row.Created          = created ?? DateTime.MinValue;
            row.CustomerLimit    = customerLimit;
            row.EndDate          = endDate ?? DateTime.MaxValue;
            row.ExclusivityType  = exclusivityType;
            row.Modified         = modified ?? DateTime.MinValue;
            row.ModifiedBy       = modifiedBy;
            row.Name             = name;
            row.OfferAmount      = offerAmount;
            row.OfferType        = offerType;

            if (settingsXml != null)
            {
                var stream = new MemoryStream();
                settingsXml.Save(stream);
                row.Params = stream.ToArray();
            }
            else
            {
                row.Params = new byte[0];
            }

            row.PerOrderLimit  = perOrderLimit;
            row.Priority       = priority;
            row.PromotionGroup = promotionGroup;
            row.PromotionId    = promotionId;
            row.PromotionType  = promotionType;
            row.StartDate      = startDate ?? DateTime.MinValue;
            row.Status         = status;

            table.AddPromotionRow(row);
            return(table);
        }