Beispiel #1
0
        public async Task GetEvaluations()
        {
            PersonalizerAdministrationClient       client      = GetPersonalizerAdministrationClient();
            AsyncPageable <PersonalizerEvaluation> evaluations = client.GetPersonalizerEvaluationsAsync();
            int numEvaluations           = 0;
            PersonalizerEvaluation eval0 = null;
            PersonalizerEvaluation eval1 = null;

            await foreach (PersonalizerEvaluation evaluation in evaluations)
            {
                numEvaluations++;
                if (numEvaluations == 1)
                {
                    eval0 = evaluation;
                }
                else if (numEvaluations == 2)
                {
                    eval1 = evaluation;
                    break;
                }
            }
            Assert.NotNull(eval0);
            Assert.NotNull(eval1);
            Assert.AreEqual("PersonalizerEvaluation", eval0.GetType().Name);
            Assert.AreEqual("Azure.AI.Personalizer.PersonalizerEvaluation", eval0.GetType().FullName);
            Assert.False(evaluations.Equals(eval1));
            var policyResult = eval0.PolicyResults;

            Assert.AreEqual(1, policyResult.Count);
            Assert.AreEqual("Custom Policy 1", policyResult[0].Name);
            Assert.AreEqual(0, policyResult[0].Summary.Count);
            Assert.AreEqual(85, policyResult[0].Arguments.Length);
            Assert.Null(policyResult[0].PolicySource);
            Assert.Null(policyResult[0].TotalSummary);
            Assert.AreEqual("myFirstEvaluation", eval0.Name);
        }