This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('FieldModel', function () { | |
| var ROWS = 3, | |
| COLUMNS = 4, | |
| sut = null; //sut = system under test | |
| //zunächst Konfigurieren wir das FieldModel mit der gewünschten Anzahl an Zeilen und Spalten | |
| beforeEach(module("xCrush", function (FieldModelProvider) { | |
| FieldModelProvider.setRows(ROWS); | |
| FieldModelProvider.setColumns(COLUMNS); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1> | |
| {{Cycle.Title}} | |
| </h1> | |
| <nav class="navbar"> | |
| <button class="btn btn-success navbar-btn" ng-click="Save()"> | |
| <span class="glyphicon glyphicon-ok"></span> | |
| Speichern | |
| </button> | |
| </nav> | |
| <div class="row"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("xAmine").controller("PlanCycleCtrl", function($scope, GetTestcasesAvailableToCycle, GetCycle, SelectableCollection){ | |
| var cycleId = 1; | |
| GetCycle(cycleId) | |
| .then(addCycleToScope) | |
| .then(GetTestcasesAvailableToCycle) | |
| .then(addTestcasesToScope); | |
| function addCycleToScope (cycle){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("xAmine").factory("SelectableCollection", function($rootScope){ | |
| function SelectableCollection(items, eventNamespace){ | |
| eventNamespace = eventNamespace || "selectable-collection"; | |
| var my = this; | |
| my.Items = items; | |
| my.Selected = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("xAmine").factory("CycleModel", function($rootScope, SelectableCollection){ | |
| function CycleModel(attrs){ | |
| var my = this; | |
| _(my).extend(attrs); | |
| my.Tests = new SelectableCollection(my.Tests, "cycle:test"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("xAmine").factory("GetCycle", function(Backend, $q, CycleModel){ | |
| return function(id){ | |
| return $q.all([ | |
| Backend.Get("Cycles", id), | |
| Backend.Get("Tests"), | |
| Backend.Get("Testcases") | |
| ]).then(function(result){ | |
| var cycle = result[0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("xAmine").factory("GetTestcasesByProject", function(Backend){ | |
| var filterBy = function(projectId){ | |
| return function(testcases){ | |
| return _(testcases).where({ProjectId: projectId}); | |
| }; | |
| }; | |
| return function(projectId){ | |
| return Backend.Get("Testcases").then(filterBy(projectId)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $stateProvider.state("wf.employee", { | |
| abstract: true, | |
| url: "employees/:id", | |
| resolve: { | |
| employee: function(EmployeeModel, $stateParams){ | |
| return EmployeeModel.get($stateParams.id); | |
| } | |
| } | |
| }).state("wf.employee.salary", { | |
| //... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $stateProvider.state("wf", { | |
| resolve: { | |
| waitForLogin: function(UserModel){ | |
| return UserModel.isLoggedIn(); | |
| } | |
| } | |
| }).state("wf.employee", { | |
| abstract: true, | |
| url: "employees/:id", |
OlderNewer