Beispiel #1
0
        public void CheckAudioForAllText_TextInRandomLangButVisibleAndNotRecorded_GivesError()
        {
            var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
										<div class='bloom-editable bloom-visibility-code-on' lang=''>
											<p>hello</p>
										</div>
									</div>
								</div>"                                );
            var results  = AccessibilityCheckers.CheckAudioForAllText(testBook);

            Assert.AreEqual(1, results.Count(), "The text has to be recorded because it is visible");
        }
Beispiel #2
0
        public void CheckAudioForAllText_AudioMissingInImageDescriptionOnly_DoesNotReport()
        {
            var testBook = GetBookWithImage($@"<div class='bloom-translationGroup bloom-imageDescription'>
										<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
					_bookData.Language1.Iso639Code
				}'>
											<p>record me!</p>
										</div>
									</div>
								</div>"                                );
            var results  = AccessibilityCheckers.CheckAudioForAllText(testBook);

            Assert.AreEqual(0, results.Count(), "No error should have been reported");
        }
Beispiel #3
0
        public void CheckAudioForAllText_TextInNationalLanguageNotVisible_NotRecorded()
        {
            var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
										<div class='bloom-editable bloom-visibility-code-off' lang='{
					_bookData.MetadataLanguage1IsoCode
				}'>
											<p>hello</p>
										</div>
									</div>
								</div>"                                );
            var results  = AccessibilityCheckers.CheckAudioForAllText(testBook);

            Assert.AreEqual(0, results.Count(), "Since the text is not visible, should not give error if not recorded");
        }
Beispiel #4
0
        public void CheckAudioForAllText_SpansAudioMissing(string content)
        {
            var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
										<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
					_bookData.Language1.Iso639Code
				}'>
											{content}
										</div>
									</div>
								</div>"                                );
            var results  = AccessibilityCheckers.CheckAudioForAllText(testBook);

            Assert.Greater(results.Count(), 0, "Error should have been reported");
        }
Beispiel #5
0
        public void CheckAudioForAllText_RecordingOnBloomEditable_NoErrors()
        {
            var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
										<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on audio-sentence' id='iExist' lang='{
					_bookData.Language1.Iso639Code
				}'>
											<p>This is the text</p>
										</div>
									</div>
								</div>"                                );

            var results = AccessibilityCheckers.CheckAudioForAllText(testBook);

            Assert.AreEqual(0, results.Count(), "No errors were expected");
        }
Beispiel #6
0
        public void CheckAudioForAllText_NoErrors(string content)
        {
            var testBook = MakeBookWithOneAudioFile($@"<div class='bloom-translationGroup'>
										<div class='bloom-editable normal-style bloom-content1 bloom-contentNational1 bloom-visibility-code-on' lang='{
					_bookData.Language1.Iso639Code
				}'>
											{content}
										</div>
									</div>
								</div>"                                );

            var results = AccessibilityCheckers.CheckAudioForAllText(testBook);

            Assert.AreEqual(0, results.Count(), "No errors were expected");
        }