public void TestAdPositionSizeAdFilterFilterAd()
 {
     IFilterAd filter = new AdPositionSizeAdFilter();
     var reqSizeId = testContextInstance.DataRow["ReqPositionSizeId"].ToString();
     var reqPositionId = Guid.NewGuid();
     var parameters = new Dictionary<string, string>();
     parameters["PositionId"] = reqPositionId.ToString();
     var Ads = testContextInstance.DataRow["Ads"].ToString().Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
     var ads = new List<Ad>();
     foreach (var item in Ads)
     {
         var ids = item.Split(new string[] { ":" }, StringSplitOptions.RemoveEmptyEntries);
         ads.Add(new AdSpotPlan() { AdSpotPlanId = new Guid(ids[0]), AdPositionSizeId = new Guid(ids[1]) });
     }
     AdPosition position = new AdPosition() { AdPositionId = reqPositionId, AdPositionSizeId = new Guid(reqSizeId) };
     var additionalParameters = new Dictionary<string, object>();
     additionalParameters["AdPosition"] = position;
     var outputs = TestContext.DataRow["Outputs"].ToString().Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
     var actual = filter.FilterAd(null, parameters, ads, null, null, null, additionalParameters);
     Assert.AreEqual(outputs.Length, actual.Count);
     foreach (var item in actual)
     {
         Assert.IsNotNull(outputs.FirstOrDefault(o => new Guid(o) == item.AdSpotPlanId));
     }
 }
Ejemplo n.º 2
0
 public AdPosition(AdPosition adPosition)
 {
     this.AdPositionId = adPosition.AdPositionId;
     this.MaxReturnAdCount = adPosition.MaxReturnAdCount;
     this.PositionType = adPosition.PositionType;
     this.AdLocationId = adPosition.AdLocationId;
     this.AdPositionSizeId = adPosition.AdPositionSizeId;
 }
Ejemplo n.º 3
0
 public AdPositionReleaseInfo(AdPosition adPosition):base(adPosition)
 { 
 }
Ejemplo n.º 4
0
 public AdPositionReleaseInfo(AdPosition adPosition) : base(adPosition)
 {
 }