public void ItDoesntAddSupportedParameterAsACustomHitType() { string testedSupportedKey = PostDataBuilder.PARAMETER_KEY_HIT_TYPE; string testedValue = "pageview"; NameValueCollection nvc = new NameValueCollection(1); nvc.Add(testedSupportedKey, testedValue); string postDataString = _postDataBuilder.BuildPostDataString(EventTracker.MEASUREMENT_PROTOCOL_VERSION, _analyticsEvent, nvc); NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(postDataString); string actualValue = nameValueCollection[testedSupportedKey]; Assert.AreNotEqual(testedValue, actualValue); var postDataCollection = _postDataBuilder.BuildPostDataCollection(EventTracker.MEASUREMENT_PROTOCOL_VERSION, _analyticsEvent, nvc); string actualCollectionValue = postDataCollection.Single(s => s.Key == testedSupportedKey).Value; Assert.AreNotEqual(testedValue, actualCollectionValue); }
private void ValidateKeyValuePairIsSetOnPostData(string key, string expectedValue, NameValueCollection customPayload = null) { string postDataString = _postDataBuilder.BuildPostDataString(EventTracker.MEASUREMENT_PROTOCOL_VERSION, _analyticsEvent, customPayload); NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(postDataString); string actualValue = nameValueCollection[key]; Assert.AreEqual(expectedValue, actualValue); var postDataCollection = _postDataBuilder.BuildPostDataCollection(EventTracker.MEASUREMENT_PROTOCOL_VERSION, _analyticsEvent, customPayload); string actualCollectionValue = postDataCollection.Single(s => s.Key == key).Value; Assert.AreEqual(expectedValue, actualCollectionValue); }