Example #1
0
        public void AddInlineImageTest_WithInlineImageUriOnly_ReturnSelfWithInlineImageAdded()
        {
            // Arrange
            Uri testInlineImageUriSrc = new Uri("C:/justatesturi.jpg");

            // Act
            ToastContentBuilder builder          = new ToastContentBuilder();
            ToastContentBuilder anotherReference = builder.AddInlineImage(testInlineImageUriSrc);

            // Assert
            Assert.AreSame(builder, anotherReference);
            Assert.AreEqual(testInlineImageUriSrc.OriginalString, (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveImage).Source);
        }
Example #2
0
        public void AddInlineImageTest_WithInlineImageAndFullOptions_ReturnSelfWithInlineImageAndOptionsAdded()
        {
            // Arrange
            Uri    testInlineImageUriSrc        = new Uri("C:/justatesturi.jpg");
            string testInlineImageAltText       = "Test Inline Image Text";
            bool   testInlineImageAddImageQuery = true;

            // Act
            ToastContentBuilder builder          = new ToastContentBuilder();
            ToastContentBuilder anotherReference = builder.AddInlineImage(testInlineImageUriSrc, testInlineImageAltText, testInlineImageAddImageQuery);

            // Assert
            Assert.AreSame(builder, anotherReference);

            var image = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveImage;

            Assert.AreEqual(testInlineImageUriSrc.OriginalString, image.Source);
            Assert.AreEqual(testInlineImageAltText, image.AlternateText);
            Assert.AreEqual(testInlineImageAddImageQuery, image.AddImageQuery);
        }