Assert.AreEqual(RecorderState.Paused, AudioRecorder.State, "Recorder should be in paused state");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.State A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void State_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.State, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P2")]
[Description("Test AudioChannels property for below minimum value.")]
Assert.That(() => AudioRecorder.AudioChannels = 0, Throws.TypeOf<ArgumentOutOfRangeException>());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed.")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.AudioChannels A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioChannels_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.AudioChannels = 2, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test AudioChannels property for Read/Write")]
{
/* Test code */
AudioRecorder.AudioChannels = 2;
- Assert.That(AudioRecorder.AudioChannels, Is.EqualTo(2), "Audio channel value is not same as set value");
+ Assert.That(AudioRecorder.AudioChannels, Is.EqualTo(2),
+ "Audio channel value is not same as set value");
}
[Test]
}
catch (NotSupportedException)
{
- Assert.That(FeatureChecker.IsSupported(Features.AudioRecorder), Is.False, "Invalid NotSupportedException");
+ Assert.That(FeatureChecker.IsSupported(Features.AudioRecorder), Is.False,
+ "Invalid NotSupportedException");
}
try
Assert.That(() => AudioRecorder.AudioDevice = (RecorderAudioDevice)(-1), Throws.ArgumentException);
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.AudioDevice A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioDevice_THROWS_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.AudioDevice = RecorderAudioDevice.Modem,
+ Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Read/Write for AudioSampleRate property")]
Assert.That(() => AudioRecorder.AudioSampleRate = -1, Throws.TypeOf<ArgumentOutOfRangeException>());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.AudioSampleRate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioSampleRate_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.AudioSampleRate = 44100, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Audio bitrate property for Read/Write")]
Assert.That(() => AudioRecorder.AudioBitRate = -1, Throws.TypeOf<ArgumentOutOfRangeException>());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.AudioBitRate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioBitRate_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.AudioBitRate = 28800, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Audiocodec property for all enum values.")]
Assert.That(() => AudioRecorder.SizeLimit = -1, Throws.TypeOf<ArgumentOutOfRangeException>());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.SizeLimit A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SizeLimit_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.SizeLimit = 1024, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test default value of Recorder Time Limit property")]
Assert.That(() => AudioRecorder.TimeLimit = -1, Throws.TypeOf<ArgumentOutOfRangeException>());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.TimeLimit A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void TimeLimit_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.TimeLimit = 2, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Muted property for Read/Write")]
Assert.IsTrue(AudioRecorder.Muted, "Mute value is not same as set value");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", " Tizen.Multimedia.Recorder.Muted A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Muted_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.That(() => AudioRecorder.Muted = false, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Prepare method")]
Assert.AreEqual(RecorderState.Ready, AudioRecorder.State, "Recorder should be in ready state");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Prepare M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Prepare_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Prepare(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Start method")]
Assert.AreEqual(RecorderState.Recording, AudioRecorder.State, "Recorder should be in recording state");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Start_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Prepare();
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Start(SavePath),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Pause method")]
Assert.AreEqual(RecorderState.Paused, AudioRecorder.State, "Recorder should be in paused state");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Pause M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Pause_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Prepare();
+
+ using (var eventWaiter = EventAwaiter<AudioStreamStoringEventArgs>.Create())
+ {
+ AudioRecorder.AudioStreamStoring += eventWaiter;
+
+ AudioRecorder.Start(SavePath);
+
+ await eventWaiter.IsRaisedAsync();
+
+ AudioRecorder.AudioStreamStoring -= eventWaiter;
+ }
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Pause(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Resume method")]
Assert.AreEqual(RecorderState.Recording, AudioRecorder.State, "Recorder should be in recording state");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Resume M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Resume_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Prepare();
+
+ using (var eventWaiter = EventAwaiter<AudioStreamStoringEventArgs>.Create())
+ {
+ AudioRecorder.AudioStreamStoring += eventWaiter;
+
+ AudioRecorder.Start(SavePath);
+
+ await eventWaiter.IsRaisedAsync();
+
+ AudioRecorder.AudioStreamStoring -= eventWaiter;
+ }
+
+ AudioRecorder.Pause();
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Resume(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Commit method")]
Assert.IsTrue(File.Exists(SavePath), "Recorded file does not exist");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Commit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Commit_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Prepare();
+
+ using (var eventWaiter = EventAwaiter<AudioStreamStoringEventArgs>.Create())
+ {
+ AudioRecorder.AudioStreamStoring += eventWaiter;
+
+ AudioRecorder.Start(SavePath);
+
+ await eventWaiter.IsRaisedAsync();
+
+ AudioRecorder.AudioStreamStoring -= eventWaiter;
+ }
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Commit(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test whether invoking Cancel method transfers state to ready state, and does not save file")]
Assert.IsFalse(File.Exists(SavePath), "Recording File should not exist");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Cancel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Cancel_THROWS_IF_DISPOSED()
+ {
+ File.Delete(SavePath);
+ AudioRecorder.Prepare();
+ AudioRecorder.Start(SavePath);
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Cancel(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder Unprepare method")]
Assert.AreEqual(RecorderState.Idle, AudioRecorder.State, "Recorder should be in created state");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.Unprepare M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Unprepare_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Prepare();
+
+ using (var eventWaiter = EventAwaiter<AudioStreamStoringEventArgs>.Create())
+ {
+ AudioRecorder.AudioStreamStoring += eventWaiter;
+
+ AudioRecorder.Start(SavePath);
+
+ await eventWaiter.IsRaisedAsync();
+
+ AudioRecorder.AudioStreamStoring -= eventWaiter;
+ }
+
+ AudioRecorder.Commit();
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.Unprepare(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder GetPeakAudioLevel method")]
Assert.IsNotNull(level, "audiolevel should not be null");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.GetPeakAudioLevel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task GetPeakAudioLevel_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Prepare();
+
+ using (var eventWaiter = EventAwaiter<AudioStreamStoringEventArgs>.Create())
+ {
+ AudioRecorder.AudioStreamStoring += eventWaiter;
+
+ AudioRecorder.Start(SavePath);
+
+ await eventWaiter.IsRaisedAsync();
+
+ AudioRecorder.AudioStreamStoring -= eventWaiter;
+ }
+
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => AudioRecorder.GetPeakAudioLevel(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Recorder GetDeviceState method for all the states.")]
Assert.That(() => AudioRecorder.ApplyAudioStreamPolicy(null), Throws.ArgumentNullException);
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if recorder is already disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Recorder.ApplyAudioStreamPolicy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void ApplyAudioStreamPolicy_THROWS_IF_DISPOSED()
+ {
+ AudioRecorder.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() =>
+ AudioRecorder.ApplyAudioStreamPolicy(new AudioStreamPolicy(AudioStreamType.Media)),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test GetSupportedFileFormats method.")]