Example #1
0
        public void AddComboBoxTest_WithMultipleChoices_ReturnSelfWithComboBoxAndAllChoicesAdded()
        {
            // Arrange
            string testComboBoxId = Guid.NewGuid().ToString();
            var    choice1        = (Guid.NewGuid().ToString(), "Test Choice 1");
            var    choice2        = (Guid.NewGuid().ToString(), "Test Choice 2");
            var    choice3        = (Guid.NewGuid().ToString(), "Test Choice 3");

            ToastContentBuilder builder = new ToastContentBuilder();

            // Act
            ToastContentBuilder anotherReference = builder.AddComboBox(testComboBoxId, choice1, choice2, choice3);

            // Assert
            Assert.AreSame(builder, anotherReference);
            var comboBox = (builder.Content.Actions as ToastActionsCustom).Inputs.First() as ToastSelectionBox;

            Assert.AreEqual(testComboBoxId, comboBox.Id);
            Assert.AreEqual(choice1.Item1, comboBox.Items[0].Id);
            Assert.AreEqual(choice2.Item1, comboBox.Items[1].Id);
            Assert.AreEqual(choice3.Item1, comboBox.Items[2].Id);

            Assert.AreEqual(choice1.Item2, comboBox.Items[0].Content);
            Assert.AreEqual(choice2.Item2, comboBox.Items[1].Content);
            Assert.AreEqual(choice3.Item2, comboBox.Items[2].Content);
        }