Skip to content

Instantly share code, notes, and snippets.

@pbedat
Created March 9, 2014 20:30
Show Gist options
  • Select an option

  • Save pbedat/9454121 to your computer and use it in GitHub Desktop.

Select an option

Save pbedat/9454121 to your computer and use it in GitHub Desktop.
GetTestcasesAvailableToCycle
angular.module("xAmine").factory("GetTestcasesAvailableToCycle", function(GetTestcasesByProject){
var filterTestcasesIn = function(cycle){
return function(testcases){
var testCasesInCycle = _.chain(cycle.Tests.Items).pluck("Testcase").pluck("Id").value();
return _(testcases).reject(function(testcase){
return _(testCasesInCycle).contains(testcase.Id);
});
};
};
return function(cycle){
return GetTestcasesByProject(cycle.ProjectId).then(filterTestcasesIn(cycle));
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment