Skip to content

Instantly share code, notes, and snippets.

View jenniferplusplus's full-sized avatar
📔
Federating

Jennifer Moore jenniferplusplus

📔
Federating
View GitHub Profile
@jonesandy
jonesandy / XUnitAsserts.cs
Last active May 26, 2024 04:06
A cheat sheet of Asserts for xUnit.net in C#
/*
STRINGS
*/
Assert.Equal(expectedString, actualString);
Assert.StartsWith(expectedString, stringToCheck);
Assert.EndsWith(expectedString, stringToCheck);
// Some can also take optional params
Assert.Equal(expectedString, actualString, ignoreCase: true);
Assert.StartsWith(expectedString, stringToCheck, StringComparison.OrdinalIgnoreCase);
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@neilk
neilk / promiseWhilePromise.js
Last active January 23, 2017 09:39
Using Q.js, a while loop where the condition is itself a promise
'use strict';
var Q = require('q');
// `condition` is a function that returns a boolean
// `body` is a function that returns a promise
// returns a promise for the completion of the loop
function promiseWhile(condition, body) {
var done = Q.defer();