GoogleAnalyticsUtilsTests.FakeAnalyticsReporterForEventsImpl.ReportPageView C# (CSharp) Method

ReportPageView() public method

public ReportPageView ( string page, string title, string host, string>.Dictionary customDimensions = null ) : void
page string
title string
host string
customDimensions string>.Dictionary
return void
        public void ReportPageView(string page, string title, string host, Dictionary<int, string> customDimensions = null)
        {
            string actualEventType, actualEventName;
            ParsePageUrl(page, out actualEventType, out actualEventName);

            Assert.IsNotNull(customDimensions);
            Assert.AreEqual(_expectedEventType, actualEventType);
            Assert.AreEqual(_expectedEventName, actualEventName);
            Assert.AreEqual(_expectedHostName, host);

            if (_expectedMetadata != null)
            {
                Assert.IsNotNull(title);
                var actualMetadata = ParseTitle(title);
                CollectionAssert.AreEqual(_expectedMetadata, actualMetadata, $"Invalid metadata.");
            }

            Assert.AreEqual(_expectedUserLoggedIn ? "true" : "false", customDimensions[IsUserSignedInIndex]);
            Assert.AreEqual("false", customDimensions[IsInternalUserIndex]);
            Assert.AreEqual(_expectedEventType, customDimensions[EventTypeIndex]);
            Assert.AreEqual(_expectedEventName, customDimensions[EventNameIndex]);
            Assert.AreEqual("true", customDimensions[IsEventHitIndex]);
            if (_expectedProjectNumberHash != null)
            {
                Assert.IsNotNull(customDimensions);
                Assert.AreEqual(_expectedProjectNumberHash, customDimensions[ProjectNumberHashIndex]);
            }
        }