Skip to content

Instantly share code, notes, and snippets.

View efleming969's full-sized avatar

Erick Fleming efleming969

  • Fleming Services, LLC
  • Frankfort, KY
View GitHub Profile
[TestClass]
public class BowlingServiceParserTest
{
[TestMethod]
public void number_from_one_to_nine_translate_to_the_number()
{
int[] result = BowlingServiceParser.Parse("123456789");
CollectionAssert.AreEqual(new int[] {1,2,3,4,5,6,7,8,9}, result);
}
@efleming969
efleming969 / acme-index
Last active May 23, 2018 21:50
acme package
const Express = require( "express" )
const Expression = require( "express-session" )
const app = Express()
app.use( Expression( {
secret: "secret",
resave: false,
saveUninitialized: false
} ) )
var index = ( function () {
var exports = {}
exports.start = function() {
console.log( "Main::start" )
$( "#frm" ).on( "submit", function( event ) {
var newGreeting = {
id: utils.generateId(),
export type GameInfo = { code: string }
export type GameEntity = { id: string, code: string, date: string, rolls: string }
export type RemoteGameData = { datePlayed: string, rolls: string }
export interface RemoteDataService {
fetch ( code: String ): Promise<RemoteGameData>
}
export interface IdentityService {
generate (): string
it( "should send an email message", function() {
var es = new EmailService();
var expectation = sinon
.mock( es )
.expects( "sendEmail" )
.withArgs( "Whazzup, Joe!" );
var g = new Greeting2( es );
it( "should build a greeting based on age", function() {
var ds = new DataService();
sinon.stub( ds, "getMessageBasedOnAge" )
.withArgs( 20 )
.returns( "Yo" );
var g = new Greeting1( ds );
var message = g.build( "Joe", 20 );
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
[TestClass]
public class MockingTests
{
[TestMethod]
public void should_send_an_email()
{
var mockEmailService = new Mock<IEmailService>();
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
[TestClass]
public class StubbingTests
{
[TestMethod]
public void should_build_a_greeting_based_on_age()
{
https://grn4aewhhg.execute-api.us-east-1.amazonaws.com/prod/games
@efleming969
efleming969 / main.test.js
Created April 11, 2017 21:18
jest test 1
var main = require( "./main" )
test( "sanity", function() {
var result = main.foo()
expect( result ).toBe( "foo" )
} )