// =====================================================================
// Create Test Objects
// =====================================================================
InternalProxy proxy = createProxy(parentProxyMock);
Object modelObject = new Object();
// =====================================================================
// Set Test Object Specific Expectations
// =====================================================================
parentProxyMock.expects.getEmbeddedModelObject(proxy, false)
.returns(modelObject);
// =====================================================================
// Test Expectations
// =====================================================================
// Get the model object before removing.
Object itemModelObjectBefore = proxy.getModelObject();
proxy.detach();
// Get the model object after removing.
Object itemModelObjectAfter = proxy.getModelObject();
assertEquals(
"Model object changed by removal", itemModelObjectBefore,
itemModelObjectAfter);
}