@@ -607,262 +607,6 @@ public virtual void RemovingVariableIsCorrect()
607607 }
608608 #endregion
609609
610- #region Getting, setting and removing properties
611- [ Test ]
612- public virtual void SettingAndGettingSimplePropertyWithUndefinedValue ( )
613- {
614- // Arrange
615- const string objectName = "employee" ;
616- const string propertyName = "firstName" ;
617- object input = Undefined . Value ;
618-
619- // Act
620- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
621- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
622- var output = _jsEngine . GetPropertyValue ( objectName , propertyName ) ;
623-
624- // Assert
625- Assert . IsFalse ( propertyExists ) ;
626- Assert . AreEqual ( input , output ) ;
627- }
628-
629- [ Test ]
630- public virtual void SettingAndGettingSimplePropertyWithNullValue ( )
631- {
632- // Arrange
633- const string objectName = "employee" ;
634- const string propertyName = "firstName" ;
635- const string input = null ;
636-
637- // Act
638- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
639- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
640- var output = _jsEngine . GetPropertyValue ( objectName , propertyName ) ;
641-
642- // Assert
643- Assert . IsTrue ( propertyExists ) ;
644- Assert . AreEqual ( input , output ) ;
645- }
646-
647- [ Test ]
648- public virtual void SettingAndGettingSimplePropertyWithBooleanValue ( )
649- {
650- // Arrange
651- const string objectName = "employee" ;
652- const string propertyName = "isAdmin" ;
653- const bool input = true ;
654-
655- // Act
656- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
657- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
658- var output = _jsEngine . GetPropertyValue < bool > ( objectName , propertyName ) ;
659-
660- // Assert
661- Assert . IsTrue ( propertyExists ) ;
662- Assert . AreEqual ( input , output ) ;
663- }
664-
665- [ Test ]
666- public virtual void SettingAndGettingSimplePropertyWithIntegerValue ( )
667- {
668- // Arrange
669- const string objectName = "employee" ;
670- const string propertyName = "age" ;
671- const int input = 29 ;
672-
673- // Act
674- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
675- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
676- var output = _jsEngine . GetPropertyValue < int > ( objectName , propertyName ) ;
677-
678- // Assert
679- Assert . IsTrue ( propertyExists ) ;
680- Assert . AreEqual ( input , output ) ;
681- }
682-
683- [ Test ]
684- public virtual void SettingAndGettingSimplePropertyWithDoubleValue ( )
685- {
686- // Arrange
687- const string objectName = "employee" ;
688- const string propertyName = "salary" ;
689- const double input = 3510.75 ;
690-
691- // Act
692- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
693- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
694- var output = _jsEngine . GetPropertyValue < double > ( objectName , propertyName ) ;
695-
696- // Assert
697- Assert . IsTrue ( propertyExists ) ;
698- Assert . AreEqual ( input , output ) ;
699- }
700-
701- [ Test ]
702- public virtual void SettingAndGettingSimplePropertyWithStringValue ( )
703- {
704- // Arrange
705- const string objectName = "employee" ;
706- const string propertyName = "lastName" ;
707- const string input = "Pupkin" ;
708-
709- // Act
710- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
711- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
712- var output = _jsEngine . GetPropertyValue < string > ( objectName , propertyName ) ;
713-
714- // Assert
715- Assert . IsTrue ( propertyExists ) ;
716- Assert . AreEqual ( input , output ) ;
717- }
718-
719- [ Test ]
720- public virtual void RemovingSimplePropertyIsCorrect ( )
721- {
722- // Arrange
723- const string objectName = "employee" ;
724- const string propertyName = "position" ;
725- const string input = "senior manager" ;
726-
727- // Act
728- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
729- bool priceBeforeRemovingExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
730- _jsEngine . RemoveProperty ( objectName , propertyName ) ;
731- bool priceAfterRemovingExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
732-
733- // Assert
734- Assert . IsTrue ( priceBeforeRemovingExists ) ;
735- Assert . IsFalse ( priceAfterRemovingExists ) ;
736- }
737-
738- [ Test ]
739- public virtual void SettingAndGettingComplexPropertyWithUndefinedValue ( )
740- {
741- // Arrange
742- const string objectName = "shop" ;
743- const string propertyName = "products.headphones.name" ;
744- object input = Undefined . Value ;
745-
746- // Act
747- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
748- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
749- var output = _jsEngine . GetPropertyValue ( objectName , propertyName ) ;
750-
751- // Assert
752- Assert . IsFalse ( propertyExists ) ;
753- Assert . AreEqual ( input , output ) ;
754- }
755-
756- [ Test ]
757- public virtual void SettingAndGettingComplexPropertyWithNullValue ( )
758- {
759- // Arrange
760- const string objectName = "shop" ;
761- const string propertyName = "products.headphones.name" ;
762- const string input = null ;
763-
764- // Act
765- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
766- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
767- var output = _jsEngine . GetPropertyValue ( objectName , propertyName ) ;
768-
769- // Assert
770- Assert . IsTrue ( propertyExists ) ;
771- Assert . AreEqual ( input , output ) ;
772- }
773-
774- [ Test ]
775- public virtual void SettingAndGettingComplexPropertyWithBooleanValue ( )
776- {
777- // Arrange
778- const string objectName = "shop" ;
779- const string propertyName = "products.headphones.isVisible" ;
780- const bool input = true ;
781-
782- // Act
783- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
784- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
785- var output = _jsEngine . GetPropertyValue < bool > ( objectName , propertyName ) ;
786-
787- // Assert
788- Assert . IsTrue ( propertyExists ) ;
789- Assert . AreEqual ( input , output ) ;
790- }
791-
792- [ Test ]
793- public virtual void SettingAndGettingComplexPropertyWithIntegerValue ( )
794- {
795- // Arrange
796- const string objectName = "shop" ;
797- const string propertyName = "products.headphones.amount" ;
798- const int input = 38 ;
799-
800- // Act
801- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
802- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
803- var output = _jsEngine . GetPropertyValue < int > ( objectName , propertyName ) ;
804-
805- // Assert
806- Assert . IsTrue ( propertyExists ) ;
807- Assert . AreEqual ( input , output ) ;
808- }
809-
810- [ Test ]
811- public virtual void SettingAndGettingComplexPropertyWithDoubleValue ( )
812- {
813- // Arrange
814- const string objectName = "shop" ;
815- const string propertyName = "products.headphones.price" ;
816- const double input = 120.55 ;
817-
818- // Act
819- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
820- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
821- var output = _jsEngine . GetPropertyValue < double > ( objectName , propertyName ) ;
822-
823- // Assert
824- Assert . IsTrue ( propertyExists ) ;
825- Assert . AreEqual ( input , output ) ;
826- }
827-
828- [ Test ]
829- public virtual void SettingAndGettingComplexPropertyWithStringValue ( )
830- {
831- // Arrange
832- const string objectName = "shop" ;
833- const string propertyName = "products.headphones.partNumber" ;
834- const string input = "BT-342011" ;
835-
836- // Act
837- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
838- bool propertyExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
839- var output = _jsEngine . GetPropertyValue < string > ( objectName , propertyName ) ;
840-
841- // Assert
842- Assert . IsTrue ( propertyExists ) ;
843- Assert . AreEqual ( input , output ) ;
844- }
845-
846- [ Test ]
847- public virtual void RemovingComplexPropertyIsCorrect ( )
848- {
849- // Arrange
850- const string objectName = "shop" ;
851- const string propertyName = "products.headphones.price" ;
852- const double input = 120.55 ;
853-
854- // Act
855- _jsEngine . SetPropertyValue ( objectName , propertyName , input ) ;
856- bool priceBeforeRemovingExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
857- _jsEngine . RemoveProperty ( objectName , propertyName ) ;
858- bool priceAfterRemovingExists = _jsEngine . HasProperty ( objectName , propertyName ) ;
859-
860- // Assert
861- Assert . IsTrue ( priceBeforeRemovingExists ) ;
862- Assert . IsFalse ( priceAfterRemovingExists ) ;
863- }
864- #endregion
865-
866610 [ TestFixtureTearDown ]
867611 public virtual void TearDown ( )
868612 {
0 commit comments