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)); }
/// 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)); }
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) }
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)); }