Пример #1
0
 public void TopLevelSettingsPUT2([PexAssumeUnderTest] SettingsGroup testGroup1, [PexAssumeUnderTest]
                                  String settingName, [PexAssumeNotNull] Object settingValue)
 {
     PexAssume.IsTrue(settingName != null);
     PexAssume.IsTrue(settingValue != null);
     PexAssume.IsTrue(testGroup1.GetSetting(settingName) != null);
     testGroup1.RemoveSetting(settingName);
     PexAssume.IsNull(testGroup1.GetSetting(settingName));
 }
Пример #2
0
        /// Summary
        /// Time: 2 min 55 sec
        /// Pattern: AAAA, Round Trip
        /// Generalizes three unit tests "FindNodeValidLeftChildTest, FindNodeValidRightChildTest, FindNodeNotInBstTest" into one PUT
        public void FindNodeValidLeftChildTest([PexAssumeUnderTest] List <int> elements, int position, int notExistingElement)
        {
            PexAssume.IsTrue(position >= 0 && position < elements.Count);
            PexAssume.IsFalse(elements.Contains(notExistingElement));
            BinarySearchTree <int> bst = new BinarySearchTree <int>(elements);

            PexAssert.IsNotNull(bst.FindNode(elements[position]));
            PexAssert.AreEqual(elements[position], bst.FindNode(elements[position]).Value);
            PexAssume.IsNull(bst.FindNode(notExistingElement));
        }
Пример #3
0
        public string CommentGetUserCommentTest([PexAssumeUnderTest] XmpTag target, string value)
        {
            PexAssume.IsNotNull(value);
            PexAssume.IsNull(target.GetLangAltNode(XmpTag.DC_NS, "description"));
            target.SetLangAltNode(XmpTag.EXIF_NS, "UserComment", value);;
            string result = target.Comment;

            PexAssert.AreEqual(result, target.GetLangAltNode(XmpTag.EXIF_NS, "UserComment"));
            return(result);
            // TODO: add assertions to method XmpTagTest.CommentGetTest(XmpTag)
        }
Пример #4
0
        public void TopLevelSettingsPUT3([PexAssumeUnderTest] SettingsGroup testGroup1, [PexAssumeUnderTest]
                                         String settingName, [PexAssumeUnderTest] Object settingValue)
        {
            PexAssume.IsTrue(settingName != null);
            PexAssume.IsTrue(settingValue != null);
            DelegateHandler dhObj = new DelegateHandler(testGroup1);

            PexAssume.IsTrue(testGroup1.GetSetting(settingName) != null);
            testGroup1.SaveSetting(settingName, testGroup1.GetSetting(settingName));
            testGroup1.RemoveSetting(settingName);
            PexAssume.IsNull(testGroup1.GetSetting(settingName));
        }