@@ -548,6 +548,72 @@ public void AddAudioTest_WithFullArgs_ReturnSelfWithCustomAudioAddedWithAllOptio
548548 Assert . AreEqual ( testToastAudioSilent , builder . Content . Audio . Silent ) ;
549549 }
550550
551+ [ TestMethod ]
552+ public void AddAudioTest_WithMsWinSoundEvent_ReturnSelfWithCustomAudioAdded ( )
553+ {
554+ // Arrange
555+ Uri testAudioUriSrc = new Uri ( "ms-winsoundevent:Notification.Reminder" ) ;
556+
557+ // Act
558+ ToastContentBuilder builder = new ToastContentBuilder ( ) ;
559+ ToastContentBuilder anotherReference = builder . AddAudio ( testAudioUriSrc ) ;
560+
561+ // Assert
562+ Assert . AreSame ( builder , anotherReference ) ;
563+ Assert . AreEqual ( testAudioUriSrc . OriginalString , builder . Content . Audio . Src . OriginalString ) ;
564+ }
565+
566+ [ TestMethod ]
567+ public void AddAudioTest_WithMsAppx_ReturnSelfWithCustomAudioAdded ( )
568+ {
569+ // Arrange
570+ Uri testAudioUriSrc = new Uri ( "ms-appx:///Assets/Audio.mp3" ) ;
571+
572+ // Act
573+ ToastContentBuilder builder = new ToastContentBuilder ( ) ;
574+ ToastContentBuilder anotherReference = builder . AddAudio ( testAudioUriSrc ) ;
575+
576+ // Assert
577+ Assert . AreSame ( builder , anotherReference ) ;
578+ Assert . AreEqual ( testAudioUriSrc . OriginalString , builder . Content . Audio . Src . OriginalString ) ;
579+ }
580+
581+ [ TestMethod ]
582+ [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
583+ public void AddAudioTest_WithInvalidMsUri_ThrowException ( )
584+ {
585+ // Arrange
586+ Uri testAudioUriSrc = new Uri ( "ms-doesntexist:Notification.Reminder" ) ;
587+
588+ // Act
589+ ToastContentBuilder builder = new ToastContentBuilder ( ) ;
590+ builder . AddAudio ( testAudioUriSrc ) ;
591+ }
592+
593+ [ TestMethod ]
594+ [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
595+ public void AddAudioTest_WithInvalidAppDataUri_ThrowException ( )
596+ {
597+ // Arrange (ms-appdata isn't currently supported)
598+ Uri testAudioUriSrc = new Uri ( "ms-appdata:///local/Sound.mp3" ) ;
599+
600+ // Act
601+ ToastContentBuilder builder = new ToastContentBuilder ( ) ;
602+ builder . AddAudio ( testAudioUriSrc ) ;
603+ }
604+
605+ [ TestMethod ]
606+ [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
607+ public void AddAudioTest_WithInvalidHttpUri_ThrowException ( )
608+ {
609+ // Arrange
610+ Uri testAudioUriSrc = new Uri ( "https://myaudio.com/song.mp3" ) ;
611+
612+ // Act
613+ ToastContentBuilder builder = new ToastContentBuilder ( ) ;
614+ builder . AddAudio ( testAudioUriSrc ) ;
615+ }
616+
551617 [ TestMethod ]
552618 public void AddAudioTest_WithAudioObject_ReturnSelfWithCustomAudioAdded ( )
553619 {
0 commit comments