(Automated Tests) Use Scene instead of Stage
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-RadioButton.cpp
index 16b38f6..666ce5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -185,10 +185,10 @@ int UtcDaliRadioButtonSelectedProperty(void)
 
   // Create the RadioButton actor
   RadioButton radioButton = RadioButton::New();
-  Stage::GetCurrent().Add( radioButton );
-  radioButton.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  radioButton.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  radioButton.SetPosition( 0.0f, 0.0f );
+  application.GetScene().Add( radioButton );
+  radioButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  radioButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  radioButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
 
   // Default selected
   DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
@@ -207,21 +207,21 @@ int UtcDaliRadioButtonSelectedProperty(void)
 
   // Test selecting radio buttons
   RadioButton radioButton2 = RadioButton::New( "label" );
-  radioButton2.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  radioButton2.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  radioButton2.SetPosition( 0.0f, 0.0f );
+  radioButton2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  radioButton2.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  radioButton2.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
 
   RadioButton radioButton3 = RadioButton::New( "label" );
-  radioButton3.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  radioButton3.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  radioButton3.SetPosition( 0.0f, 40.0f );
+  radioButton3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  radioButton3.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  radioButton3.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 40.0f ));
 
   Actor radioGroup = Actor::New();
-  Stage::GetCurrent().Add( radioGroup );
-  radioGroup.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  radioGroup.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  radioGroup.SetPosition( 0.0f, 0.0f );
-  radioGroup.SetSize( 400.0f, 400.0 );
+  application.GetScene().Add( radioGroup );
+  radioGroup.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  radioGroup.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  radioGroup.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+  radioGroup.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0 ) );
 
   radioGroup.Add( radioButton2 );
   radioGroup.Add( radioButton3 );
@@ -335,55 +335,3 @@ int UtcDaliRadioButtonSelectedProperty(void)
 
   END_TEST;
 }
-
-
-// Deprecated API Tests
-
-int UtcDaliRadioButtonLabelActor(void)
-{
-  ToolkitTestApplication application;
-
-  std::string labelText = "test actor 1";
-
-  RadioButton radioButton = RadioButton::New();
-
-  radioButton.SetProperty( Toolkit::Button::Property::LABEL,
-                          Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
-                                         .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
-                        );
-
-  radioButton.SetLabelText( labelText );
-
-  DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText, TEST_LOCATION );
-
-  std::string labelText2 = "test actor 2";
-  radioButton.SetLabelText( labelText2 );
-  DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText2, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliRadioButtonSelected(void)
-{
-  ToolkitTestApplication application;
-
-  RadioButton radioButton = RadioButton::New();
-
-  // Default selected
-  DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
-  // False
-  radioButton.SetSelected( false );
-  DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
-  // True
-  radioButton.SetSelected( true );
-  DALI_TEST_CHECK( radioButton.IsSelected() == true );
-
-  // False
-  radioButton.SetSelected( false );
-  DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
-  END_TEST;
-}
-