Assert.AreEqual(RadioState.Scanning, Radio.State, "state is not scanning");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.State A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void State_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.State, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Frequency property of radio.")]
Assert.Throws<ArgumentOutOfRangeException>(() => Radio.Frequency = 86500);
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.Frequency A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Frequency_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.Frequency, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SignalStrength property of radio.")]
Assert.GreaterOrEqual(result, -128, "Signal strength is not greater or equal than -128dBm");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.SignalStrength A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SignalStrength_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.SignalStrength, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test IsMuted Property of radio.")]
Assert.IsFalse(Radio.IsMuted, "Raio is muted, default is not muted");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.IsMuted A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsMuted_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.IsMuted, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ChannelSpacing property.")]
Assert.Greater(result, 0, "ChannelSpacing should be greater than 0.");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.ChannelSpacing A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void ChannelSpacing_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.ChannelSpacing, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test Volume property.")]
Assert.Throws<ArgumentOutOfRangeException>(() => Radio.Volume = -1.0f);
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.Volume A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Volume_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.Volume, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test FrequencyRange property for min value.")]
Assert.LessOrEqual(result.Max, 108000, "frequency should be lesser than or equal 108kHz");
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.FrequencyRange A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void FrequencyRange_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.That(() => Radio.FrequencyRange, Throws.TypeOf<ObjectDisposedException>(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test StartScan method status.")]
Assert.Throws<InvalidOperationException>(() => Radio.StartScan());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.StartScan M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void StartScan_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => Radio.StartScan(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test StopScan method status.")]
* 2. Start scanning.
*/
Radio.ScanStopped += eventAwaiter;
- Radio.StartScan();
- await Task.Delay(300);
- Radio.StopScan();
- await eventAwaiter.IsRaisedAsync(_radioScanMaxTime);
- Assert.AreEqual(RadioState.Ready, Radio.State, "state is not ready");
+ try
+ {
+ Radio.StartScan();
+ await Task.Delay(300);
+
+ Radio.StopScan();
+ await eventAwaiter.IsRaisedAsync(_radioScanMaxTime);
+ Assert.AreEqual(RadioState.Ready, Radio.State, "state is not ready");
+ }
+ finally
+ {
+ Radio.ScanStopped -= eventAwaiter;
+ }
}
}
Assert.Throws<InvalidOperationException>(() => Radio.StopScan());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.StopScan M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void StopScan_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => Radio.StopScan(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SeekUpAsync method return.")]
Assert.ThrowsAsync<InvalidOperationException>(() => Radio.SeekUpAsync());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.SeekUpAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SeekUpAsync_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.ThrowsAsync<ObjectDisposedException>(() => Radio.SeekUpAsync(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test SeekDownAsync method return.")]
Assert.ThrowsAsync<InvalidOperationException>(() => Radio.SeekDownAsync());
}
+ [Test]
+ [Category("P2")]
+ [Description("Throws if radio object is already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Radio.SeekDownAsync M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SeekDownAsync_THROWS_IF_DISPOSED()
+ {
+ Radio.Dispose();
+
+ Assert.ThrowsAsync<ObjectDisposedException>(() => Radio.SeekDownAsync(),
+ "Should throws proper exception");
+ }
+
[Test]
[Category("P1")]
[Description("Test ScanUpdated event.")]
* 2. Start Scanning.
*/
Radio.ScanUpdated += eventAwaiter;
- Radio.StartScan();
- Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime), "The event should be raised.");
+ try
+ {
+ Radio.StartScan();
+
+ Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime),
+ "The event should be raised.");
+ }
+ finally
+ {
+ Radio.ScanUpdated -= eventAwaiter;
+ }
}
}
* 2. Start scanning.
*/
Radio.ScanStopped += eventAwaiter;
- Radio.StartScan();
- await Task.Delay(300);
- Radio.StopScan();
- Assert.IsTrue(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime), "The event should be raised.");
+ try
+ {
+ Radio.StartScan();
+ await Task.Delay(300);
+
+ Radio.StopScan();
+ Assert.IsTrue(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime),
+ "The event should be raised.");
+ }
+ finally
+ {
+ Radio.ScanStopped -= eventAwaiter;
+ }
}
}
*/
Radio.ScanCompleted += eventAwaiter;
- Radio.StartScan();
+ try
+ {
+ Radio.StartScan();
- Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime));
+ Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime));
+ }
+ finally
+ {
+ Radio.ScanCompleted -= eventAwaiter;
+ }
}
}
Radio.Interrupted += eventAwaiter;
/* TESTCODE */
- Radio.Start();
- Radio2.Start();
-
- Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime), "The event should be raised.");
+ try
+ {
+ Radio.Start();
+ Radio2.Start();
+
+ Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime),
+ "The event should be raised.");
+ }
+ finally
+ {
+ Radio.Interrupted -= eventAwaiter;
+ }
}
-
}
}
}