Exemplo n.º 1
0
        public void UrchinUriBuilder_GetParameters_For_Environment_Returns_Correct_Values()
        {
            var environment = new Environment("en-gb")
            {
                CharacterSet     = "ISO-8550-1",
                FlashVersion     = "11.0.1b",
                ScreenColorDepth = 32,
                IpAddress        = "127.0.0.1",
                JavaEnabled      = true,
                ScreenHeight     = 1050,
                ScreenWidth      = 1920,
                ViewportHeight   = 768,
                ViewportWidth    = 1024
            };

            var parameters = UrchinUriBuilder.GetParameters(environment).ToDictionary(k => k.Key, v => v.Value);

            Assert.AreEqual("ISO-8550-1", parameters["utmcs"]);
            Assert.AreEqual("en-gb", parameters["utmul"]);
            Assert.AreEqual("11.0.1b", parameters["utmfl"]);
            Assert.AreEqual("32-bit", parameters["utmsc"]);
            Assert.AreEqual("127.0.0.1", parameters["utmip"]);
            Assert.AreEqual("1", parameters["utmje"]);
            Assert.AreEqual("1024x768", parameters["utmvp"]);
            Assert.AreEqual("1920x1050", parameters["utmsr"]);
        }
Exemplo n.º 2
0
        public void UrchinUriBuilder_GetParameters_For_Environment_Returns_Correct_Keys()
        {
            var environment = new Environment("utf-8");

            var keys = UrchinUriBuilder.GetParameters(environment).Select(k => k.Key).ToArray();

            CollectionAssert.AreEquivalent(new[] { "utmul", "utmcs", "utmje", "utmfl" }, keys);
        }
Exemplo n.º 3
0
        public void UrchinUriBuilder_GetParameters_For_Configuration_Returns_Correct_Keys()
        {
            var configuration = new UrchinConfiguration("UA-1234-5", "hostName");

            var keys = UrchinUriBuilder.GetParameters(configuration).Select(k => k.Key).ToArray();

            CollectionAssert.AreEquivalent(new[] { "utmac", "utmhn", "aip" }, keys);
        }
Exemplo n.º 4
0
        public void UrchinUriBuilder_GetParameters_For_Environment_Returns_Correct_Utmje_Value()
        {
            var environment = new Environment("en-gb")
            {
                JavaEnabled = false
            };

            var utmjeValue = UrchinUriBuilder.GetParameters(environment).First(f => f.Key == "utmje").Value;

            Assert.AreEqual("0", utmjeValue);
        }
Exemplo n.º 5
0
        public void UrchinUriBuilder_GetParameters_For_Configuration_Returns_No_Aip_Value_When_False()
        {
            var configuration = new UrchinConfiguration("UA-1234-5", "hostName")
            {
                AnonymizeIp = false
            };

            var keys = UrchinUriBuilder.GetParameters(configuration).Select(k => k.Key).ToArray();

            CollectionAssert.DoesNotContain(keys, "aip");
        }