Skip to content

Instantly share code, notes, and snippets.

@toddpi314
Created June 8, 2012 15:40
Show Gist options
  • Save toddpi314/2896227 to your computer and use it in GitHub Desktop.
Save toddpi314/2896227 to your computer and use it in GitHub Desktop.
Rich_Domain_Components_UnloadTest
test("Component Unload Tests", function() {
var componentTestCount = 10;
var components = []
for (var i = 0; i <= componentTestCount - 1; i++) {
components.push(new DeepElement.ThreeOneFour.Component());
}
var comonentLoader = new DeepElement.ThreeOneFour.Helpers.ComponentLoader(
components);
comonentLoader.load(
function() {
comonentLoader.unload(function() {
var unloadedComponents = 0;
for (var i = 0; i <= components.length - 1; i++) {
var component = components[i];
if (!component.getLoaded()) unloadedComponents++;
}
ok(
unloadedComponents == componentTestCount, "Problem unloading the " + componentTestCount + " test components");
});
}, function() {
ok(false, "Problem loading the " + componentTestCount + " test components");
});
});​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment