* 1. Enable Bluetooth
*/
Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
- Assert.IsNotNull(_attributeObjs, "PRECONDITION Failed: Test data is not initialized properly, null _attributes");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
/* TEST CODE */
foreach (KeyValuePair<BluetoothGattAttribute, AttributeTestData> item in _attributeObjs)
* 1. Enable Bluetooth
*/
Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
- Assert.IsNotNull(_attributeObjs, "PRECONDITION Failed: Test data is not initialized properly, null _attributes");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
/* TEST CODE */
foreach (KeyValuePair<BluetoothGattAttribute, AttributeTestData> item in _attributeObjs)
try
{
int signedInt8Value = sbyte.MaxValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.SignedInt8, signedInt8Value, _valueOffset);
}
catch (Exception ex)
try
{
int signedInt16Value = Int16.MaxValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.SignedInt16, signedInt16Value, _valueOffset);
}
catch (Exception ex)
try
{
int signedInt32Value = Int32.MaxValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.SignedInt32, signedInt32Value, _valueOffset);
}
catch (Exception ex)
try
{
int unsignedInt8Value = byte.MaxValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.UnsignedInt8, unsignedInt8Value, _valueOffset);
}
catch (Exception ex)
try
{
int unsignedInt16Value = UInt16.MaxValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.UnsignedInt16, unsignedInt16Value, _valueOffset);
}
catch (Exception ex)
{
// UInt32.MaxValue can not be set to a int variable. CAPI only allow int values.
int unsignedInt32Value = unchecked((int)UInt32.MaxValue);
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.UnsignedInt32, unsignedInt32Value, _valueOffset);
}
catch (Exception ex)
try
{
int signedInt8Value = sbyte.MinValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.SignedInt8, signedInt8Value, _valueOffset);
}
catch (Exception ex)
try
{
int signedInt16Value = Int16.MinValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.SignedInt16, signedInt16Value, _valueOffset);
}
catch (Exception ex)
try
{
int signedInt32Value = Int32.MinValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.SignedInt32, signedInt32Value, _valueOffset);
}
catch (Exception ex)
try
{
int unsignedInt8Value = byte.MinValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.UnsignedInt8, unsignedInt8Value, _valueOffset);
}
catch (Exception ex)
try
{
int unsignedInt16Value = UInt16.MinValue;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.UnsignedInt16, unsignedInt16Value, _valueOffset);
}
catch (Exception ex)
{
// UInt32.MaxValue can not be set to a int variable. CAPI only allow int values.
int unsignedInt32Value = unchecked((int)UInt32.MinValue);
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetIntValues(IntDataType.UnsignedInt32, unsignedInt32Value, _valueOffset);
}
catch (Exception ex)
try
{
int mantissa = 123, exponent = 2;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetFloatValue(FloatDataType.Float, mantissa, exponent, _valueOffset);
}
catch (Exception ex)
try
{
int mantissa = -123, exponent = 2;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetFloatValue(FloatDataType.SFloat, mantissa, exponent, _valueOffset);
}
catch (Exception ex)
try
{
int mantissa = 42, exponent = 5;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetFloatValue(FloatDataType.SFloat, mantissa, exponent, _valueOffset);
}
catch (Exception ex)
try
{
int mantissa = -42, exponent = 5;
+
+ Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
TestGetSetFloatValue(FloatDataType.SFloat, mantissa, exponent, _valueOffset);
}
catch (Exception ex)
* 1. Enable Bluetooth
*/
Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
- Assert.IsNotNull(_attributeObjs, "PRECONDITION Failed: Test data is not initialized properly, null _attributes");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
/* TEST CODE */
foreach (KeyValuePair<BluetoothGattAttribute, AttributeTestData> item in _attributeObjs)
* 1. Enable Bluetooth
*/
Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
- Assert.IsNotNull(_attributeObjs, "PRECONDITION Failed: Test data is not initialized properly, null _attributes");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
/* TEST CODE */
foreach (KeyValuePair<BluetoothGattAttribute, AttributeTestData> item in _attributeObjs)
* 1. Enable Bluetooth
*/
Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
- Assert.IsNotNull(_attributeObjs, "PRECONDITION Failed: Test data is not initialized properly, null _attributes");
+
+ /* After completing the precondition, TCT can be run
+ "_attributeObjs is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_attributeObjs == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
foreach (KeyValuePair<BluetoothGattAttribute, AttributeTestData> item in _attributeObjs)
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for BT LE TEST");
Information.TryGetValue("http://tizen.org/feature/network.bluetooth", out _isBluetoothSupported);
Information.TryGetValue("http://tizen.org/feature/network.bluetooth.le", out _isBluetoothLeSupported);
+
+ if (_isBluetoothSupported == false || _isBluetoothLeSupported == false)
+ {
+ /* The precondition function should not be called in not supported case */
+ return;
+ }
+
try
{
Assert.IsTrue(BluetoothAdapter.IsBluetoothEnabled, "PRECONDITION Failed: Bluetooth services should have beeen initialised");
Assert.Fail("Bluetooth is not enabled");
return;
}
+
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
BluetoothLeAdvertiseData leAdvertiseDataInstance = new BluetoothLeAdvertiseData();
Assert.IsInstanceOf<BluetoothLeAdvertiseData>(leAdvertiseDataInstance, "Should return BluetoothLeAdvertiseData instance.");
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with enum value : BluetoothLePacketType.BluetoothLeAdvertisingPacket
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
foreach (BluetoothLeAdvertisingMode val in _connectEnums)
{
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
// Test with connect value true
return;
}
+ /* After completing the precondition, TCT can be run
+ "_advertiseData is null" case, only le supported feature is NULL.
+ other case is abnormal, so assert fail */
+ if (_advertiseData == null)
+ {
+ Assert.IsTrue(_isBluetoothLeSupported == false, "Invalid NotSupportedException");
+ return;
+ }
+
/* TEST CODE */
BluetoothLeAdvertiseData newAdvertiseData = new BluetoothLeAdvertiseData();
Assert.IsNotNull(newAdvertiseData, "PRECONDITION: Failed to get AdvertiseData for testing");