public void MeasurementUriBuilderTests_GetParameters_For_Environment_Returns_Correct_Je_Value()
        {
            var environment = new TestableEnvironment("en-gb") { JavaEnabled = false };

            var jeValue = MeasurementUriBuilder.GetParameters(environment).First(f => f.Key == "je").Value;

            Assert.AreEqual("0", jeValue);
        }
        public void TestableEnvironment_Constructor_Sets_Properties_Correctly()
        {
            var environment = new TestableEnvironment("en-gb")
            {
                CharacterSet     = "iso-8550-1",
                FlashVersion     = "11.0.1b",
                ScreenColorDepth = 32,
                JavaEnabled      = true,
                ScreenHeight     = 1050,
                ScreenWidth      = 1920,
                ViewportHeight   = 768,
                ViewportWidth    = 1024
            };

            Assert.AreEqual("iso-8550-1", environment.CharacterSet);
            Assert.AreEqual("en-gb", environment.LanguageCode);
            Assert.AreEqual("11.0.1b", environment.FlashVersion);
            Assert.AreEqual(32u, environment.ScreenColorDepth);
            Assert.AreEqual(true, environment.JavaEnabled);
            Assert.AreEqual(1050u, environment.ScreenHeight);
            Assert.AreEqual(1920u, environment.ScreenWidth);
            Assert.AreEqual(768u, environment.ViewportHeight);
            Assert.AreEqual(1024u, environment.ViewportWidth);
        }
        public void MeasurementUriBuilderTests_GetParameters_For_Environment_Returns_Correct_Values()
        {
            var environment = new TestableEnvironment("en-gb")
                {
                    CharacterSet = "ISO-8550-1",
                    FlashVersion = "11.0.1b",
                    ScreenColorDepth = 32,
                    JavaEnabled = true,
                    ScreenHeight = 1050,
                    ScreenWidth = 1920,
                    ViewportHeight = 768,
                    ViewportWidth = 1024
                };

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

            Assert.AreEqual("ISO-8550-1", parameters["de"]);
            Assert.AreEqual("en-gb", parameters["ul"]);
            Assert.AreEqual("11.0.1b", parameters["fl"]);
            Assert.AreEqual("32-bit", parameters["sd"]);
            Assert.AreEqual("1", parameters["je"]);
            Assert.AreEqual("1024x768", parameters["vp"]);
            Assert.AreEqual("1920x1050", parameters["sr"]);
        }
Пример #4
0
        public void TestableEnvironment_Constructor_Sets_Properties_Correctly()
        {
            var environment = new TestableEnvironment("en-gb")
            {
                CharacterSet = "iso-8550-1",
                FlashVersion = "11.0.1b",
                ScreenColorDepth = 32,
                JavaEnabled = true,
                ScreenHeight = 1050,
                ScreenWidth = 1920,
                ViewportHeight = 768,
                ViewportWidth = 1024
            };

            Assert.AreEqual("iso-8550-1", environment.CharacterSet);
            Assert.AreEqual("en-gb", environment.LanguageCode);
            Assert.AreEqual("11.0.1b", environment.FlashVersion);
            Assert.AreEqual(32u, environment.ScreenColorDepth);
            Assert.AreEqual(true, environment.JavaEnabled);
            Assert.AreEqual(1050u, environment.ScreenHeight);
            Assert.AreEqual(1920u, environment.ScreenWidth);
            Assert.AreEqual(768u, environment.ViewportHeight);
            Assert.AreEqual(1024u, environment.ViewportWidth);
        }