Opened 10 years ago

Closed 10 years ago

#369 closed defect (fixed)

This ticket contains 5 Defects ID: 1014109,1014117,1014118,1014123,985011. All of the five defects are related to the Remove method. They have the same problem and could be fixed using a same way.

Reported by: jessicacao Owned by: Tom Fukushima
Priority: medium Milestone: 2.0
Component: General Version:
Severity: major Keywords: Remove
Cc: Trevor Wekel External ID: 1014109,1014117,1014118,1014123,985011

Description

  1. Construct an instance of MgClassDefinitionCollection? using the following code

MgClassDefinitionCollection? classDefColl = new MgClassDefinitionCollection?();

  1. Construct an instance of MgClassDefinition? using the following code

MgClassDefinition? classDef = new MgClassDefinition?();

  1. Use the method Remove(MgClassDefinition? value) to return a bool type value.

Sample code:

Assert.IsFalse?(classDefColl.Remove(classDef));

Expect result: False Actual result: True

Change History (5)

comment:1 Changed 10 years ago by jiab

Owner: changed from Tom Fukushima to jiab

comment:2 Changed 10 years ago by jessicacao

Keywords: Remove added; MgClassDefinitionCollection::Remove removed
Summary: MgClassDefinitionCollection::Remove(MgClassDefinition value) returns a wrong value when the instance of MgClassDefinitionCollection is empty.This ticket contains 5 Defects ID: 1014109,1014117,1014118,1014123,985011. All of the five defects are related to the Remove method. They have the same problem and could be fixed using a same way.



This ticket contains 5 Defects ID: 1014109,1014117,1014118,1014123,985011. All of the five defects are related to the Remove method. They have the same problem and could be fixed using a same way.

Their descriptions are bellow:

1.985011

MgStringPropertyCollection::Remove(MgStringProperty? value) returns a wrong value when the instance of MgStringPropertyCollection? is empty.

Step to recur:

  1. Construct an instance of MgStringPropertyCollection? using the following code

MgStringPropertyCollection? stringPropertyCollection = new MgStringPropertyCollection?();

  1. Construct an instance of MgStringProperty? using the following code

MgStringProperty? stringProperty = new MgStringPropert?("stringProperty","testString");

c Use the method Remove(MgStringProperty? value) to return a bool type value.

Sample code:

private MgStringPropertyCollection? stringPropertyCollection;
private MgStringProperty? stringProperty;
stringPropertyCollection = new MgStringPropertyCollection?();
stringProperty = new MgStringProperty? ("stringProperty","testString");
bool bRet = stringPropertyCollection.Remove(stringProperty);

Assert.IsTrue?(bRet);

Expect result: False
Actual result: True

2.1014109

MgClassDefinitionCollection::Remove(MgClassDefinition? value) returns a wrong value when the instance of MgClassDefinitionCollection? is empty.

Step to recur:

  1. Construct an instance of MgClassDefinitionCollection? using the following code

MgClassDefinitionCollection? classDefColl = new MgClassDefinitionCollection?();

  1. Construct an instance of MgClassDefinition? using the following code

MgClassDefinition? classDef = new MgClassDefinition?();

  1. Use the method Remove(MgClassDefinition? value) to return a bool type value.

Sample code:

Assert.IsFalse?(classDefColl.Remove(classDef));

Expect result: False
Actual result: True

3.1014117

MgFeatureSchemaCollection:: Remove(MgFeatureSchema? value) returns a wrong value when the instance of MgFeatureSchemaCollection? is empty.

Step to recur:

  1. Construct an instance of MgFeatureCommandCollection? using the following code

MgFeatureCommandCollection? featComColl = new MgFeatureCommandCollection?();

  1. Construct an instance of MgFeatureCommand? using the following code

strClassName = "FeatureClassName?";
strFilterText = "FilterText?";

prop1 = new MgBooleanProperty?("prop1", true);
prop2 = new MgBooleanProperty?("prop2", false);

propColl1 = new MgPropertyCollection?();
propColl2 = new MgPropertyCollection?();

propColl1.Add(prop1);
propColl1.Add(prop2);
propColl2.Add(prop2);

MgUpdateFeatures? updateFeat = new MgUpdateFeatures?(strClassName, propColl1, strFilterText);

  1. Use the method Remove(MgFeatureCommand? command) to return a bool type value.

Sample code:

Assert.IsFalse?(featComColl.Remove((MgFeatureCommand?)updateFeat));

Expect result: False
Actual result: True

4.1014118

MgMapCollection::Remove(MgMapBase? value) returns a wrong value when the instance of MgMapCollection? is empty.

Step to recur:

  1. Construct an instance of MgMapCollection? using the following code

MgMapCollection? mapColl = new MgMapCollection?();

  1. Construct an instance of MgMapBase? using the following code

MgMapBase? mapBase = new MgMapBase?();

  1. Use the method Remove(MgMapBase? value)to return a bool type value.

Sample code:

Assert.IsFalse?(mapColl.Remove(mapBase));

Expect result: False
Actual result: True

5.1014123

MgPropertyDefinitionCollection:: Remove(MgPropertyDefinition? value) returns a wrong value when the instance of MgMapCollection? is empty.

Step to recur:

  1. Construct an instance of MgPropertyDefinitionCollection? using the following code

MgPropertyDefinitionCollection? propDefColl = new MgPropertyDefinitionCollection?();

  1. Construct an instance of MgPropertyDefinition? using the following code

MgPropertyDefinition? propDef = new MgPropertyDefinition?("propName", MgPropertyType?.Boolean);

  1. Use the method Remove(MgPropertyDefinition? value)to return a bool type value.

Sample code:

Assert.IsFalse?(propDefColl.Remove(propDef));

Expect result: False
Actual result: True

comment:3 Changed 10 years ago by jessicacao

Owner: changed from jiab to Tom Fukushima

comment:4 Changed 10 years ago by jessicacao

External ID: 10141091014109,1014117,1014118,1014123,985011

comment:5 Changed 10 years ago by trevorwekel

Resolution: fixed
Status: newclosed

Patch submitted by Jessica Cao

http://trac.osgeo.org/mapguide/changeset/2696

Note: See TracTickets for help on using tickets.