Exemplo n.º 1
0
        private async Task RankMultiSlotNoOptions(PersonalizerClient client)
        {
            // Action
            PersonalizerMultiSlotRankResult response = await client.RankMultiSlotAsync(actions, slots, contextFeatures);

            // Assert
            Assert.AreEqual(slots.Count, response.Slots.Count);
            // Assertions for first slot
            PersonalizerSlotResult responseSlot1 = response.Slots[0];

            Assert.AreEqual(slot1.Id, responseSlot1.SlotId);
            Assert.AreEqual("NewsArticle", responseSlot1.RewardActionId);
            // Assertions for second slot
            PersonalizerSlotResult responseSlot2 = response.Slots[1];

            Assert.AreEqual(slot2.Id, responseSlot2.SlotId);
            Assert.AreEqual("SportsArticle", responseSlot2.RewardActionId);
        }
Exemplo n.º 2
0
        private async Task RankMultiSlotNullParameters(PersonalizerClient client)
        {
            PersonalizerRankMultiSlotOptions request = new PersonalizerRankMultiSlotOptions(actions, slots);
            // Action
            PersonalizerMultiSlotRankResult response = await client.RankMultiSlotAsync(request);

            // Assert
            Assert.AreEqual(slots.Count, response.Slots.Count);
            // Assertions for first slot
            PersonalizerSlotResult responseSlot1 = response.Slots[0];

            Assert.AreEqual(slot1.Id, responseSlot1.SlotId);
            Assert.AreEqual("NewsArticle", responseSlot1.RewardActionId);
            // Assertions for second slot
            PersonalizerSlotResult responseSlot2 = response.Slots[1];

            Assert.AreEqual(slot2.Id, responseSlot2.SlotId);
            Assert.AreEqual("SportsArticle", responseSlot2.RewardActionId);
        }
Exemplo n.º 3
0
        private async Task RankMultiSlot(PersonalizerClient client)
        {
            string eventId = "sdkTestEventId";
            PersonalizerRankMultiSlotOptions request = new PersonalizerRankMultiSlotOptions(actions, slots, contextFeatures, eventId);
            // Action
            PersonalizerMultiSlotRankResult response = await client.RankMultiSlotAsync(request);

            // Assert
            Assert.AreEqual(slots.Count, response.Slots.Count);
            // Assertions for first slot
            PersonalizerSlotResult responseSlot1 = response.Slots[0];

            Assert.AreEqual(slot1.Id, responseSlot1.SlotId);
            Assert.AreEqual("NewsArticle", responseSlot1.RewardActionId);
            // Assertions for second slot
            PersonalizerSlotResult responseSlot2 = response.Slots[1];

            Assert.AreEqual(slot2.Id, responseSlot2.SlotId);
            Assert.AreEqual("SportsArticle", responseSlot2.RewardActionId);
        }