From: Haesu Gwon Date: Sat, 22 Aug 2020 09:18:42 +0000 (+0900) Subject: [Radio][Non-ACR] Add new negative TCs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82b935a22aae24265d8c4f3e4c74470fb721bdf6;p=test%2Ftct%2Fcsharp%2Fapi.git [Radio][Non-ACR] Add new negative TCs Change-Id: Iaa13027b2f14d4994105f17d627c67b08b1f0b23 --- diff --git a/tct-suite-vs/Tizen.Radio.Tests/testcase/TSRadio.cs b/tct-suite-vs/Tizen.Radio.Tests/testcase/TSRadio.cs index 73d54ac63..df9173800 100755 --- a/tct-suite-vs/Tizen.Radio.Tests/testcase/TSRadio.cs +++ b/tct-suite-vs/Tizen.Radio.Tests/testcase/TSRadio.cs @@ -148,6 +148,21 @@ namespace Tizen.Multimedia.Tests 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test Frequency property of radio.")] @@ -232,6 +247,21 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test SignalStrength property of radio.")] @@ -249,6 +279,21 @@ namespace Tizen.Multimedia.Tests 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test IsMuted Property of radio.")] @@ -287,6 +332,21 @@ namespace Tizen.Multimedia.Tests 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test ChannelSpacing property.")] @@ -305,6 +365,21 @@ namespace Tizen.Multimedia.Tests 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test Volume property.")] @@ -408,6 +483,21 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test FrequencyRange property for min value.")] @@ -442,6 +532,21 @@ namespace Tizen.Multimedia.Tests 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(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test StartScan method status.")] @@ -484,6 +589,21 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => 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(() => Radio.StartScan(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test StopScan method status.")] @@ -501,12 +621,20 @@ namespace Tizen.Multimedia.Tests * 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; + } } } @@ -522,6 +650,21 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => 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(() => Radio.StopScan(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test SeekUpAsync method return.")] @@ -553,6 +696,21 @@ namespace Tizen.Multimedia.Tests Assert.ThrowsAsync(() => 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(() => Radio.SeekUpAsync(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test SeekDownAsync method return.")] @@ -585,6 +743,21 @@ namespace Tizen.Multimedia.Tests Assert.ThrowsAsync(() => 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(() => Radio.SeekDownAsync(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test ScanUpdated event.")] @@ -602,9 +775,18 @@ namespace Tizen.Multimedia.Tests * 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; + } } } @@ -625,11 +807,20 @@ namespace Tizen.Multimedia.Tests * 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; + } } } @@ -650,9 +841,16 @@ namespace Tizen.Multimedia.Tests */ Radio.ScanCompleted += eventAwaiter; - Radio.StartScan(); + try + { + Radio.StartScan(); - Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime)); + Assert.That(await eventAwaiter.IsRaisedAsync(_radioScanMaxTime)); + } + finally + { + Radio.ScanCompleted -= eventAwaiter; + } } } @@ -674,12 +872,19 @@ namespace Tizen.Multimedia.Tests 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; + } } - } } }