コード例 #1
0
        /// <summary>
        /// Obtain the key/value pairs for a ContentViewActivity.
        /// </summary>
        /// <param name="appView">AppViewActivity to turn into key/value pairs.</param>
        /// <returns>Key/value pairs representing this ContentViewActivity.</returns>
        internal static IEnumerable<KeyValuePair<string, string>> GetParameters(AppViewActivity appView)
        {
            yield return KeyValuePair.Create("t", "appview");

            foreach (var pair in GetSharedParameters(appView))
                yield return pair;
        }
コード例 #2
0
        public void MeasurementActivityTracker_GetParameter_For_AppViewActivity_Returns_Correct_Values()
        {
            var activity = new AppViewActivity("page");

            var parameters = MeasurementActivityTracker.GetParameters(activity).ToDictionary(k => k.Key, v => v.Value);

            Assert.AreEqual(2, parameters.Count);
            Assert.AreEqual("appview", parameters["t"]);
            Assert.AreEqual("page", parameters["cd"]);
        }
コード例 #3
0
        public void AppViewActivity_Constructor_With_Minimal_Parameters_Sets_Correct_Properties()
        {
            var activity = new AppViewActivity("screenName");

            Assert.AreEqual("screenName", activity.ScreenName);
        }