Ejemplo n.º 1
0
		public void Set_Set_Unset_TargettingProperty()
		{
			Banner.TargettingProperty propertyToTest1 = Banner.TargettingProperty.Gender_Unknown;
			Banner.TargettingProperty propertyToTest2 = Banner.TargettingProperty.CreditCard_Unknown;

			Banner b = new Banner();
			b.SetTargettingProperty(propertyToTest1, true);
			b.SetTargettingProperty(propertyToTest2, true);

			Assert.IsTrue(b.TargettingPropertiesToExclude[(int)propertyToTest1]);
			Assert.IsTrue(b.TargettingPropertiesToExclude[(int)propertyToTest2]);

			b.SetTargettingProperty(propertyToTest1, false);
			Assert.IsFalse(b.TargettingPropertiesToExclude[(int)propertyToTest1]);
		}
Ejemplo n.º 2
0
		public void TargettingProperties_SetTargettingProperty()
		{
			Banner.TargettingProperty propertyToTest = Banner.TargettingProperty.CreditCard_False;

			Banner b = new Banner();
			Assert.IsFalse(b.TargettingPropertiesToExclude[(int)propertyToTest]);

			b.SetTargettingProperty(propertyToTest, true);
			Assert.IsTrue(b.TargettingPropertiesToExclude[(int)propertyToTest]);

			foreach (Banner.TargettingProperty tp in Enum.GetValues(typeof(Banner.TargettingProperty)))
			{
				if (tp == propertyToTest) { continue; }
				Assert.IsFalse(b.TargettingPropertiesToExclude[(int)tp]);
			}

			b.SetTargettingProperty(propertyToTest, false);
			foreach (Banner.TargettingProperty tp in Enum.GetValues(typeof(Banner.TargettingProperty)))
			{
				Assert.IsFalse(b.TargettingPropertiesToExclude[(int)tp]);
			}
		}