Exemple #1
0
        /// <summary>
        /// Returns the stored data for the requested active experiment, for testing purposes only.
        /// </summary>
        /// <param name="experimentId">The id of the experiment to look for.</param>
        /// <exception cref="System.NullReferenceException">Thrown when there is no data for the experiment.</exception>
        /// <returns>The `RecordedExperimentData` for the experiment</returns>
        public RecordedExperimentData TestGetExperimentData(string experimentId)
        {
            Dispatchers.AssertInTestingMode();

            string rawData = LibGleanFFI.glean_experiment_test_get_data(experimentId).AsString();

            return(RecordedExperimentData.FromJsonString(rawData));
        }
Exemple #2
0
        /// <summary>
        /// Tests whether an experiment is active, for testing purposes only.
        /// </summary>
        /// <param name="experimentId">The id of the experiment to look for.</param>
        /// <returns>true if the experiment is active and reported in pings, otherwise false</returns>
        public bool TestIsExperimentActive(string experimentId)
        {
            Dispatchers.AssertInTestingMode();

            return(LibGleanFFI.glean_experiment_test_is_active(experimentId) != 0);
        }