File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
tests/IntegrationTests/AudioNodeTests Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -227,4 +227,26 @@ public async Task SetMaxDecibelsAsync_ShouldUpdateMaxDecibels(double maxDecibels
227227 double readMaxDecibels = await node . GetMaxDecibelsAsync ( ) ;
228228 _ = readMaxDecibels . Should ( ) . Be ( maxDecibels ) ;
229229 }
230+
231+ [ Test ]
232+ [ TestCase ( - 100 , - 110 ) ]
233+ [ TestCase ( 50 , 0 ) ]
234+ public async Task SetMaxDecibelsAsync_ThrowsIndexSizeErrorException_WhenSetLowerThanMinDecibels ( double minDecibels , double maxDecibels )
235+ {
236+ // Arrange
237+ await using AudioContext context = await GetAudioContextAsync ( ) ;
238+
239+ await using AnalyserNode node = await AnalyserNode . CreateAsync ( JSRuntime , context , new ( )
240+ {
241+ MinDecibels = minDecibels ,
242+ MaxDecibels = minDecibels + 1 ,
243+ } ) ;
244+
245+ // Act
246+
247+ Func < Task > action = async ( ) => await node . SetMaxDecibelsAsync ( maxDecibels ) ;
248+
249+ // Assert
250+ _ = await action . Should ( ) . ThrowAsync < IndexSizeErrorException > ( ) ;
251+ }
230252}
You can’t perform that action at this time.
0 commit comments