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
#include <iostream> | |
#include <CppUTest/CommandLineTestRunner.h> | |
#include <CppUTestExt/MockSupport.h> | |
using namespace std; | |
class Foo | |
{ | |
public: | |
virtual void MyFunction(int something) |
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
#ifndef MemLeakCheckingTest_h | |
#define MemLeakCheckingTest_h | |
#include <gtest/gtest.h> | |
#if defined(WIN32) && defined(_DEBUG) | |
// Used to redirect _CrtXXX functions output to stderr, instead of the MSVC | |
// trace window. | |
int __cdecl crtReportHook(int reportType, char *szMsg, int *retVal) |
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
extern "C" | |
{ | |
int InitSQL(); | |
int Rollback(); | |
int Commit(); | |
int DoMySelect(MyItem** ppItems); | |
}; | |
void DoSomethingTheOldWay(); |
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
#rails gen model Player name:string | |
class Player < ActiveRecord:Base | |
has_many :wins, :class_name => "Game", :foreign_key => "winner" | |
has_many :losses, :class_name => "Game", :foreign_key => "loser" | |
end | |
#rails gen model Game winner:integer loser:integer | |
class Game < ActiveRecord:Base | |
belongs_to :winner, :class_name => "Player", :foreign_key => "player_id" | |
belongs_to :loser, :class_name => "Player", :foreign_key => "player_id" |
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
void Sub exampleBtn_Click(Object sender, EventArgs e) | |
{ | |
if( txtBox1.Value <> "" ) then | |
if( txtBox1.Value = "some other bad thing" ) then | |
Exit Sub | |
end if | |
end if | |
' 50 million things like this, sometimes nested deeper | |
} |
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
using NUnit.Framework; | |
using Noesis.Javascript.Headless; | |
using Noesis.Javascript.Headless.Reporters; | |
namespace Noesis.Javascript.Headless.Example.Specs | |
{ | |
[TestFixture] | |
public class JasmineSpecs | |
{ | |
private JavaScriptTestRunner _jsTestRunner; |
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 class ResultsReporter : IJavaScriptReporter | |
{ | |
private readonly Dictionary<string, string> _results = new Dictionary<string,string>(); | |
public Dictionary<string, string> Results | |
{ | |
get { return _results; } | |
} | |
public string Result | |
{ |
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 static class EnumerableExtensions | |
{ | |
public static void ForEach<T>(this IEnumerable<T> items, Action<T> action) | |
{ | |
foreach (var item in items) | |
action(item); | |
} | |
} |
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('Backbone View Example', function () { | |
beforeEach(function () { | |
this.collection = jasmine.createSpyObj(MyModels, ['bind']); | |
this.view = new MyView({collection: this.collection}); | |
}); | |
it('should render itself when the collection changes', function () { | |
expect(this.collection.bind) | |
.toHaveBeenCalledWith(['change', this.view.render]); | |
}); |
OlderNewer