public void TestEventParametersCleared()
        {
            MATTestWrapper.Instance.SetEventContentType("testContentType");
            MATTestWrapper.Instance.SetEventContentId("testContentId");
            MATTestWrapper.Instance.SetEventLevel(3);
            MATTestWrapper.Instance.SetEventQuantity(63);
            MATTestWrapper.Instance.SetEventSearchString("testSearchString");
            MATTestWrapper.Instance.SetEventRating(493.23);
            MATTestWrapper.Instance.SetEventDate1(new DateTime(2013, 3, 4, 5, 6, 7));
            MATTestWrapper.Instance.SetEventDate2(new DateTime(2013, 3, 4, 5, 6, 7));
            MATTestWrapper.Instance.SetEventAttribute1("attr1");
            MATTestWrapper.Instance.SetEventAttribute2("attr2");
            MATTestWrapper.Instance.SetEventAttribute3("attr3");
            MATTestWrapper.Instance.SetEventAttribute4("attr4");
            MATTestWrapper.Instance.SetEventAttribute5("attr5");

            MATTestWrapper.Instance.MeasureAction("purchase");
            MATTestParams.Sleep(3000);

            Assert.IsTrue(param.CheckDefaultValues());
            Assert.IsTrue(param.CheckKeyHasValue("content_type"));
            Assert.IsTrue(param.CheckKeyHasValue("content_id"));
            Assert.IsTrue(param.CheckKeyHasValue("level"));
            Assert.IsTrue(param.CheckKeyHasValue("quantity"));
            Assert.IsTrue(param.CheckKeyHasValue("search_string"));
            Assert.IsTrue(param.CheckKeyHasValue("rating"));
            Assert.IsTrue(param.CheckKeyHasValue("date1"));
            Assert.IsTrue(param.CheckKeyHasValue("date2"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub1"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub2"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub3"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub4"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub5"));

            param = new MATTestParams();
            MATTestWrapper.Instance.MeasureAction("purchase");
            MATTestParams.Sleep(3000);

            Assert.IsTrue(param.CheckDefaultValues());
            Assert.IsFalse(param.CheckKeyHasValue("content_type"));
            Assert.IsFalse(param.CheckKeyHasValue("content_id"));
            AssertKeyValue("level", 0.ToString());
            AssertKeyValue("quantity", 0.ToString());
            Assert.IsFalse(param.CheckKeyHasValue("search_string"));
            AssertKeyValue("rating", 0.ToString());
            Assert.IsFalse(param.CheckKeyHasValue("date1"));
            Assert.IsFalse(param.CheckKeyHasValue("date2"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub1"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub2"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub3"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub4"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub5"));
        }
 public void AssertNoValueForKey(string key)
 {
     Assert.IsFalse(param.CheckKeyHasValue(key));
 }
Exemple #3
0
        public void TestEventParametersCleared()
        {
            MATTestWrapper.Instance.SetEventContentType("testContentType");
            MATTestWrapper.Instance.SetEventContentId("testContentId");
            MATTestWrapper.Instance.SetEventLevel(3);
            MATTestWrapper.Instance.SetEventQuantity(63);
            MATTestWrapper.Instance.SetEventSearchString("testSearchString");
            MATTestWrapper.Instance.SetEventRating(493.23);
            MATTestWrapper.Instance.SetEventDate1(new DateTime(2013, 3, 4, 5, 6, 7));
            MATTestWrapper.Instance.SetEventDate2(new DateTime(2013, 3, 4, 5, 6, 7));
            MATTestWrapper.Instance.SetEventAttribute1("attr1");
            MATTestWrapper.Instance.SetEventAttribute2("attr2");
            MATTestWrapper.Instance.SetEventAttribute3("attr3");
            MATTestWrapper.Instance.SetEventAttribute4("attr4");
            MATTestWrapper.Instance.SetEventAttribute5("attr5");

            MATTestWrapper.Instance.MeasureAction("purchase");
            MATTestParams.Sleep(3000);

            Assert.IsTrue(param.CheckDefaultValues());
            Assert.IsTrue(param.CheckKeyHasValue("content_type"));
            Assert.IsTrue(param.CheckKeyHasValue("content_id"));
            Assert.IsTrue(param.CheckKeyHasValue("level"));
            Assert.IsTrue(param.CheckKeyHasValue("quantity"));
            Assert.IsTrue(param.CheckKeyHasValue("search_string"));
            Assert.IsTrue(param.CheckKeyHasValue("rating"));
            Assert.IsTrue(param.CheckKeyHasValue("date1"));
            Assert.IsTrue(param.CheckKeyHasValue("date2"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub1"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub2"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub3"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub4"));
            Assert.IsTrue(param.CheckKeyHasValue("attribute_sub5"));

            param = new MATTestParams();
            MATTestWrapper.Instance.MeasureAction("purchase");
            MATTestParams.Sleep(3000);

            Assert.IsTrue(param.CheckDefaultValues());
            Assert.IsFalse(param.CheckKeyHasValue("content_type"));
            Assert.IsFalse(param.CheckKeyHasValue("content_id"));
            AssertKeyValue("level", 0.ToString());
            AssertKeyValue("quantity", 0.ToString());
            Assert.IsFalse(param.CheckKeyHasValue("search_string"));
            AssertKeyValue("rating", 0.ToString());
            Assert.IsFalse(param.CheckKeyHasValue("date1"));
            Assert.IsFalse(param.CheckKeyHasValue("date2"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub1"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub2"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub3"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub4"));
            Assert.IsFalse(param.CheckKeyHasValue("attribute_sub5"));
        }