This file contains 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
// omdb | |
/* | |
angular.module('omdb', []) | |
.factory('omdbApi', function($http, $q) { | |
var service = {}; | |
var baseUrl = 'http://www.omdbapi.com/?v=1&'; | |
function httpPromise (url) { |
This file contains 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
//movie-core | |
/* angular.module('movieCore', ['ngResource']) | |
.factory('PopularMovies', function($resource) { | |
var token = 'teddybear'; // TBC | |
return $resource('popular/:movieId', { movieId: '@id' }, { | |
update: { | |
method: 'PUT', | |
headers: { 'authToken': token } | |
}, |
This file contains 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('omdb service', function() { | |
var movieData = {"Search":[{"Title":"Star Wars: Episode IV - A New Hope","Year":"1977","imdbID":"tt0076759","Type":"movie"},{"Title":"Star Wars: Episode V - The Empire Strikes Back","Year":"1980","imdbID":"tt0080684","Type":"movie"},{"Title":"Star Wars: Episode VI - Return of the Jedi","Year":"1983","imdbID":"tt0086190","Type":"movie"},{"Title":"Star Wars: Episode I - The Phantom Menace","Year":"1999","imdbID":"tt0120915","Type":"movie"},{"Title":"Star Wars: Episode III - Revenge of the Sith","Year":"2005","imdbID":"tt0121766","Type":"movie"},{"Title":"Star Wars: Episode II - Attack of the Clones","Year":"2002","imdbID":"tt0121765","Type":"movie"},{"Title":"Star Wars: The Clone Wars","Year":"2008","imdbID":"tt1185834","Type":"movie"},{"Title":"Star Wars: The Clone Wars","Year":"2008–2015","imdbID":"tt0458290","Type":"series"},{"Title":"Star Wars: Clone Wars","Year":"2003–2005","imdbID":"tt0361243","Type":"series"},{"Title":"The Star Wars Holiday Special","Year":"1978","i |
This file contains 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
var Game = function(name){ | |
this.name = name; | |
} |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Jasmine Spec Runner v2.0.2</title> | |
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.0.2/jasmine_favicon.png"> | |
<link rel="stylesheet" type="text/css" href="lib/jasmine-2.0.2/jasmine.css"> | |
<script type="text/javascript" src="lib/jasmine-2.0.2/jasmine.js"></script> |
This file contains 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("The Game", function() { | |
var game; | |
beforeEach(function() { | |
game = new Game("Conway's"); | |
}); | |
it("should be Conway's Game of Life", function() { | |
expect(game.name).toEqual("Conway's"); | |
}); |
This file contains 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
static class Guard | |
{ | |
public static void AgainstNulls(object parameter, string name) | |
{ | |
if (parameter == null) | |
{ | |
throw new ArgumentNullException(name); | |
} | |
} | |
} |
This file contains 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
public MyClass( | |
IDependency1 dependency1, | |
IDependency2 dependency2, | |
IDependency3 dependency3, | |
IDependency4 dependency4) | |
{ | |
dependency1.ThrowIfNull("dependency1"); | |
dependency2.ThrowIfNull("dependency2"); | |
dependency3.ThrowIfNull("dependency3"); | |
dependency4.ThrowIfNull("dependency4"); |
This file contains 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
public MyClass( | |
IDependency1 dependency1, | |
IDependency2 dependency2, | |
IDependency3 dependency3, | |
IDependency4 dependency4) | |
{ | |
if (dependency1 == null) | |
{ | |
throw new ArgumentNullException("dependency1"); | |
} |
NewerOlder