Skip to content

Instantly share code, notes, and snippets.

@JaykeOps
JaykeOps / AutoFixtureLearningTests.cs
Created January 5, 2018 10:39
Autofixture Custom SpecimenBuilder Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.Kernel;
using Xunit;
namespace AutoFixtureSandbox.Tests
{
@JaykeOps
JaykeOps / ClassExamples.ts
Created September 2, 2017 15:58
Just some notes I took while following allong the TypeScript documentation
//1.0 TypeScript Inheritance
class Diety {
constructor(protected name: string) {
}
}
interface IDietyAction {
(name: string): void
};
@JaykeOps
JaykeOps / InterfaceExamples.ts
Created September 2, 2017 13:49
Just some notes I took while following along the TypeScript documentation.
//1.0 Interface declared on function
function printBirthday(birthday: { Date: Date, Age: number, Name: string}) {
console.log(birthday.Name + "'s " + (birthday.Age + 1) + "th birthday"
+ " is on " + birthday.Date + ".");
}
let person = { Name: "Karl", Age: 32, Date: new Date(), Occupation: "Painter" };
printBirthday(person);
@JaykeOps
JaykeOps / DesctructingExamples.ts
Last active September 2, 2017 08:11
Just some notes I took while going through the TypeScript documentation
//Destructuring Examples
//1.0 Array destructing
let travelClasses = [200, 500, 1000];
let [economy, business, first] = travelClasses;
console.log("Business class price:" + business); //500