- What is a "unit test"? What is an "integration test"? "integrated test"? "microtest"?
- WHY unit test?
- ROI vs other automation (writing & MAINTAINING)
- Synergy between testability and design
- internal quality
- Agile, iterative, refactoring
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 interface IPrincipalInformationProvider | |
{ | |
bool IsLoggedIn { get; } | |
... | |
} | |
public class ThreadBasedPrincipalInformationProvider : IPrincipalInformationProvider | |
{ | |
public bool IsLoggedIn |
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
(define lorem | |
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." | |
) | |
;; tests | |
;; (equal? (split (list 1 2 3) 0) (list () (list 1 2 3)) ) | |
;; (equal? (split () 5) (list () ()) ) | |
;; (equal? (split (list 1 2 3) 4) (list (list 1 2 3) ()) ) |
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
let isValid input = | |
input | |
|> parse | |
/*smelly and doesn't scale, what's the F# way of combining predicates?*/ | |
|> (fun p -> predicate1 p && predicate2 p) |
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 appAPI = (function () { | |
var tabListener; | |
var backGroundListener; | |
var storedValue = null; | |
return { | |
ready: function (callback) { callback(); }, | |
message: { | |
addListener: function (listener) { |
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
let add : (int option -> int option -> int option) = | |
(fun fst snd -> | |
fst | |
|> Option.bind | |
(fun f -> | |
snd | |
|> Option.bind (fun s -> Some (f + s)))) | |
test <@ add (Some 1) (Some 2) = Some 3 @> | |
test <@ add None (Some 2) = None @> |
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
BEGIN TRAN | |
DELETE FROM [oltp.cq.logging.2.10.0.x].dbo.AUD_EXC | |
DELETE FROM [oltp.cq.logging.2.10.0.x].dbo.AUD_ACT | |
USE [oltp.cq.stage.2.10.0.x] | |
DELETE FROM QCD_CYC | |
DELETE FROM QCD_EVT | |
DELETE FROM QUA_CYC |
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
#r @"C:\nuget_local\Unquote.3.1.1\lib\net45\Unquote.dll" | |
open Swensen.Unquote | |
type Vote = {voter : string; first : string; second : string; third : string} | |
let lines = | |
System.IO.File.ReadAllLines(@"C:\Users\ext_jvy\Desktop\hubspot-form-submissions-ae-hackathon-2017-public-voting-2017-04-28 (1).csv") | |
|> List.ofArray | |
|> List.skip 1 |
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
internal static class BundleExtensions | |
{ | |
public static Bundle WithLastModifiedToken(this Bundle sb) | |
{ | |
sb.Transforms.Add(new LastModifiedBundleTransform()); | |
return sb; | |
} | |
public class LastModifiedBundleTransform : IBundleTransform | |
{ | |
public void Process(BundleContext context, BundleResponse response) |
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
type Direction = North | East |South | West | |
type Location = { x : int; y : int} | |
type Rover = { Location : Location; Direction : Direction} | |
let createRover location direction = {Location = location; Direction = direction} | |
type Command = | |
| Forward | |
| Backward | |
| TurnLeft |
OlderNewer