fakeiteasy - the simple way to get fakes done

16
FakeItEasy The simple way to get fakes done Akim Khalilov

Upload: akim-khalilov

Post on 25-May-2015

1.134 views

Category:

Technology


0 download

DESCRIPTION

This talk is about FakeItEasy - the modern isolation framework with simple API. Details can be found in my post http://sstude.com/blog/2013/02/18/the-simple-way-to-get-fakes-done/

TRANSCRIPT

Page 1: FakeItEasy - The simple way to get fakes done

FakeItEasy The simple way to get

fakes done

Akim Khalilov

Page 2: FakeItEasy - The simple way to get fakes done

2

Agenda

• Why do we need fake objects

• Fake objects – what are they?

• What is FakeItEasy?

• Examples

• More examples

Page 3: FakeItEasy - The simple way to get fakes done

3

Why should we use fake objects?

Do not use real bullets. Do not hurt

anyone.

Page 4: FakeItEasy - The simple way to get fakes done

4

Family of fakes

All depends on usage

Page 5: FakeItEasy - The simple way to get fakes done

5

How can we build our fakes?

Hand Rolled Fake Objects

Hard to implement

Can take a lot of time

Hard to support

Existing frameworks

Easy to start

Easy to build things

Easy to write

Easy to maintain

Page 6: FakeItEasy - The simple way to get fakes done

6

Select one of many:

But not only…

It’s a matter

of taste

Page 7: FakeItEasy - The simple way to get fakes done

7

FakeItEasy

Page 8: FakeItEasy - The simple way to get fakes done

8

Patrik Hägne github.com/patrik-hagne

twitter.com/patrik_hagne

https://

github.com/fakeiteasy

Created by this man

Sweden

Page 9: FakeItEasy - The simple way to get fakes done

9

Start with simple `A`

Page 10: FakeItEasy - The simple way to get fakes done

10

Asserting

Page 11: FakeItEasy - The simple way to get fakes done

11

Argument Constraints

Page 12: FakeItEasy - The simple way to get fakes done

12

A Call To Method

Page 13: FakeItEasy - The simple way to get fakes done

13

A Call To Fake

Page 14: FakeItEasy - The simple way to get fakes done

14

Assert the order

Page 15: FakeItEasy - The simple way to get fakes done

15

Anything else?

• https://github.com/fakeiteasy

• http://pluralsight.com/training/Courses/Table

OfContents/fakeiteasy

• http://ondevelopment.blogspot.com/

Page 16: FakeItEasy - The simple way to get fakes done

16

Thank you!

@sstude

http://sstude.com