{"componentChunkName":"component---gatsby-theme-mdx-deck-src-templates-deck-js","path":"/","matchPath":"/*","result":{"data":{"deck":{"id":"920dde17-3e7c-5715-b5bb-140fb80b5406","body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar themes = [github, customTheme];\nvar _frontmatter = {};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar layoutProps = {\n  themes: themes,\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(Head, {\n    mdxType: \"Head\"\n  }, mdx(\"title\", null, \"Unit Testing: Deconstructed\"), mdx(\"meta\", {\n    name: \"twitter:card\",\n    content: \"summary\"\n  }), mdx(\"meta\", {\n    name: \"twitter:site\",\n    content: \"@_emilol\"\n  }), mdx(\"meta\", {\n    name: \"twitter:title\",\n    content: \"Unit Testing: Deconstructed\"\n  }), mdx(\"meta\", {\n    name: \"twitter:description\",\n    content: \"Slide deck - Emily Taylor\"\n  }), mdx(\"meta\", {\n    name: \"twitter:image\",\n    content: \"https://unit-testing-deconstructed.emilol.com/static/unit-testing.png\"\n  })), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h2\", null, \"Unit Testing: Deconstructed\"), mdx(QRCode, {\n    value: \"http://unit-testing-deconstructed.emilol.com/\",\n    mdxType: \"QRCode\"\n  })), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"Things we know about Unit Tests\"), mdx(\"ol\", {\n    style: {\n      textAlign: 'left'\n    }\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(ListItem, {\n    marker: \"\\uD83E\\uDDEB\",\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Unit\"), \" - code with \", mdx(\"i\", null, \"one\"), \" responsibility/reason to change\"), mdx(ListItem, {\n    marker: \"\\uD83E\\uDDEA\",\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Unit Test\"), \" - test one Unit \"), mdx(ListItem, {\n    marker: \"\\uD83E\\uDDF0\",\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Mocks\"), \" - isolate Unit under test \")))), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: customTheme,\n    height: \"10px\",\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"file=./components/UnitTest.cs\",\n    \"file\": \"./components/UnitTest.cs\"\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1:18 file=./components/UnitTest.cs title=\\\"Arrange\\\"\",\n    \"1:18\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Arrange\\\"\"\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"20:21 file=./components/UnitTest.cs title=\\\"Act\\\"\",\n    \"20:21\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Act\\\"\"\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"22:25 file=./components/UnitTest.cs title=\\\"Assert\\\"\",\n    \"22:25\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Assert\\\"\"\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"file=./components/UnitTest.cs\",\n    \"file\": \"./components/UnitTest.cs\"\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h2\", null, \"\\uD83E\\uDDEB What is a Unit?\"), mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(\"p\", null, \"SOLID?\"))), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, \"Unit definition closely linked to SOLID principles, in particular the S for \\\"Single Responsibility Principle\\\"\"), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"iframe\", {\n    src: \"https://player.vimeo.com/video/157708450\",\n    width: \"640\",\n    height: \"360\",\n    frameBorder: \"0\",\n    allow: \"autoplay; fullscreen\",\n    allowFullScreen: true\n  }), mdx(BlockQuote, {\n    mdxType: \"BlockQuote\"\n  }, mdx(\"i\", null, \"Kevlin Henney - SOLID Deconstruction \"), mdx(\"br\", null), mdx(\"a\", {\n    href: \"https://vimeo.com/157708450\"\n  }, \"https://vimeo.com/157708450\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"The single responsibility principle states that every \", mdx(\"b\", null, \"module, class, or function\"), \" should have responsibility over a \", mdx(\"b\", null, \"single part of the functionality\"), \", and that responsibility should be entirely encapsulated by the class, module or function...\"), mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"The term was introduced by Robert C. Martin [...]. Martin described it as being based on the \", mdx(\"b\", null, \"principle of cohesion\"), \", as described by Tom DeMarco in his book \", mdx(\"i\", null, \"Structured Analysis and System Specification (1978)\"), \".\")), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"em\", {\n    parentName: \"p\"\n  }, mdx(\"a\", _extends({\n    parentName: \"em\"\n  }, {\n    \"href\": \"https://en.wikipedia.org/wiki/Single_responsibility_principle\"\n  }), \"https://en.wikipedia.org/wiki/Single_responsibility_principle\"))))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Image, {\n    src: ebay,\n    style: {\n      backgroundSize: 'contain'\n    },\n    mdxType: \"Image\"\n  })), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Cohesion, {\n    mdxType: \"Cohesion\"\n  })), mdx(Notes, {\n    mdxType: \"Notes\"\n  }, \"Coupling people tend to understand, it's almost tangible. Most developers tend to understand it inherently. Cohesion tends to be a bit trickier.\"), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(BlockQuote, {\n    mdxType: \"BlockQuote\"\n  }, \"Cohesion comes from the same root word that \\u201Cadhesion\\u201D comes from. It\\u2019s a word about sticking.\"), mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"When something adheres to something else (when it\\u2019s \", mdx(\"b\", null, \"adhesive\"), \", in other words) it\\u2019s a \", mdx(\"b\", null, \"one-sided, external thing\"), \": something (like glue) is sticking one thing to another.\"), mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"Things that are \", mdx(\"b\", null, \"cohesive\"), \", on the other hand, \", mdx(\"b\", null, \"naturally stick to each other\"), \" because they are of like kind, or because they fit so well together.\")), mdx(BlockQuote, {\n    mdxType: \"BlockQuote\"\n  }, mdx(\"i\", null, \"Glenn Vanderburg, Cohesion\"), mdx(\"br\", null), mdx(\"a\", {\n    href: \"https://vanderburg.org/blog/2011/01/31/cohesion.html\"\n  }, \"https://vanderburg.org/blog/2011/01/31/cohesion.html\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"\\uD83E\\uDDEB What is a Unit?\"), mdx(\"ul\", {\n    style: {\n      textAlign: 'left'\n    }\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(ListItem, {\n    mdxType: \"ListItem\"\n  }, \"A cohesive module, class or function\"), mdx(ListItem, {\n    mdxType: \"ListItem\"\n  }, \"A collection of one (or more!) responsibilities\"), mdx(ListItem, {\n    mdxType: \"ListItem\"\n  }, \"Should be treated as a whole\")))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"But TDD!\"), mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(\"div\", null, \"Test one thing\"))), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: customTheme,\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1:25 file=./components/UnitTest.cs\",\n    \"1:25\": true,\n    \"file\": \"./components/UnitTest.cs\"\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1[3],21[20:53],25[100] file=./components/UnitTest.cs title=\\\"Testing a behavior\\\"\",\n    \"1[3],21[20:53],25[100]\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Testing\",\n    \"a\": true,\n    \"behavior\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1[3],4[20:100],6[18:100],8[26:100],11[28:100],25[100],14:18 file=./components/UnitTest.cs title=\\\"Isolating one Unit\\\"\",\n    \"1[3],4[20:100],6[18:100],8[26:100],11[28:100],25[100],14:18\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Isolating\",\n    \"one\": true,\n    \"Unit\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1[3],4[44:100],6[42:100],8[58:100],9[20:51],11[60:100],12[21:38],25[100],14[25:100],15:18 file=./components/UnitTest.cs title=\\\"Tightly coupled to the code structure\\\"\",\n    \"1[3],4[44:100],6[42:100],8[58:100],9[20:51],11[60:100],12[21:38],25[100],14[25:100],15:18\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Tightly\",\n    \"coupled\": true,\n    \"to\": true,\n    \"the\": true,\n    \"code\": true,\n    \"structure\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1:25 file=./components/UnitTest.cs title=\\\"But that's TDD, right?\\\"\",\n    \"1:25\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"But\",\n    \"that's\": true,\n    \"TDD,\": true,\n    \"right?\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, mdx(\"p\", null, \"American software engineer \", mdx(\"b\", null, \"Kent Beck\"), \", who is credited with having developed or \\\"rediscovered\\\" the technique, stated in 2003 that TDD encourages simple designs and inspires confidence.\"), mdx(\"p\", null, \"...based on the book \", mdx(\"i\", null, mdx(\"b\", null, \"Test-Driven Development by Example\")))), mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"For TDD, a unit is most commonly defined as a \", mdx(\"b\", null, \"class, or a group of related functions often called a module\"), \". Keeping units relatively small is claimed to provide critical benefits...\")), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"em\", {\n    parentName: \"p\"\n  }, mdx(\"a\", _extends({\n    parentName: \"em\"\n  }, {\n    \"href\": \"https://en.wikipedia.org/wiki/Test-driven_development\"\n  }), \"https://en.wikipedia.org/wiki/Test-driven_development\"))))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"div\", {\n    style: {\n      display: 'flex',\n      flexDirection: 'column',\n      alignItems: 'center'\n    }\n  }, mdx(\"img\", {\n    src: bookfound,\n    style: {\n      flex: 1,\n      height: 'calc(85vh - 84px)',\n      paddingTop: '2rem'\n    }\n  }), mdx(BlockQuote, {\n    style: {\n      flex: 1\n    },\n    mdxType: \"BlockQuote\"\n  }, mdx(\"a\", {\n    href: \"https://bookfound.com/products/119438\"\n  }, \"https://bookfound.com/products/119438\")))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Image, {\n    src: tdd,\n    style: {\n      backgroundSize: 'contain'\n    },\n    mdxType: \"Image\"\n  })), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"Our design must consist of many \", mdx(\"b\", null, \"highly cohesive, loosely coupled\"), \" components, just to make testing easy.\"), mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(BlockQuote, {\n    highlight: true,\n    mdxType: \"BlockQuote\"\n  }, \"What \", mdx(\"b\", null, \"behavior\"), \" will we need to produce the revised report? Put another way, what set of tests, when passed, \", mdx(\"b\", null, \"will demonstrate\"), \" the presence of code \", mdx(\"b\", null, \"we are confident\"), \" will compute the report correctly?\")), mdx(BlockQuote, {\n    mdxType: \"BlockQuote\"\n  }, mdx(\"i\", null, \"Kent Beck, TDD By Example - 2002\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"iframe\", {\n    width: \"560\",\n    height: \"315\",\n    src: \"https://www.youtube.com/embed/EZ05e7EMOLM\",\n    frameBorder: \"0\",\n    allow: \"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\",\n    allowFullScreen: true\n  }), mdx(BlockQuote, {\n    mdxType: \"BlockQuote\"\n  }, mdx(\"i\", null, \"Ian Cooper - TDD, Where Did It All Go Wrong \"), mdx(\"br\", null), mdx(\"a\", {\n    href: \"https://www.youtube.com/watch?v=EZ05e7EMOLM\"\n  }, \"https://www.youtube.com/watch?v=EZ05e7EMOLM\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"TDD By Example\"), mdx(\"ul\", {\n    style: {\n      textAlign: 'left',\n      width: '80vw'\n    }\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Test behaviors\"), \" not implementation details.\"), mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Test outside in\"), \" - start from a use case, and work down to more granular scenarios when testing specific behaviors.\"), mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Focus on testing the public API\"), \" at your chosen abstraction level (the surface of the module).\"), mdx(Onion, {\n    mdxType: \"Onion\"\n  })))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"\\uD83E\\uDDEA What is a Unit Test?\"), mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(\"div\", null, \"For Kent Beck it is a test that 'runs in isolation' from \", mdx(\"i\", null, \"other tests\")))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"div\", {\n    style: {\n      display: 'flex',\n      flexDirection: 'column',\n      alignItems: 'center'\n    }\n  }, mdx(\"img\", {\n    src: tweet,\n    style: {\n      flex: 1,\n      minHeight: '259px',\n      height: '25vw',\n      paddingTop: '2rem'\n    }\n  }), mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(\"div\", null, \"\\uD83D\\uDC49 \", mdx(\"a\", {\n    href: \"https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3\",\n    style: {\n      flex: 1\n    }\n  }, \"Test Desiderata\"), \" \\uD83E\\uDD70\")))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"Test Desiderata\"), mdx(\"ul\", {\n    style: {\n      textAlign: 'left',\n      width: '65vw'\n    }\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, \" \", mdx(\"b\", null, \"Behavioral\"), \" sensitive to changes in the behavior of the code under test. If the behavior changes, the test result should change.\"), mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, \" \", mdx(\"b\", null, \"Structure-insensitive\"), \" tests should not change their result if the structure of the code changes.\"), mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, \" \", mdx(\"b\", null, \"Isolated\"), \" return the same results regardless of the order in which they are run. \"), mdx(ListItem, {\n    highlight: true,\n    mdxType: \"ListItem\"\n  }, \" \", mdx(\"b\", null, \"Writable\"), \" cheap to write relative to the cost of the code being tested. \")))), mdx(\"hr\", null), mdx(CodeSurfer, {\n    theme: customTheme,\n    mdxType: \"CodeSurfer\"\n  }, mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"file=./components/UnitTest.cs title=\\\"🧰 Practically, what does it all mean?\\\"\",\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"🧰\",\n    \"Practically,\": true,\n    \"what\": true,\n    \"does\": true,\n    \"it\": true,\n    \"all\": true,\n    \"mean?\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1[3],4[20:100],6[18:100],8[26:100],11[28:100],25[100],14:18 file=./components/UnitTest.cs title=\\\"Isolated ✅\\\"\",\n    \"1[3],4[20:100],6[18:100],8[26:100],11[28:100],25[100],14:18\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Isolated\",\n    \"✅\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1[3],4[20:100],6[18:100],8[26:100],11[28:100],25[100],14:18 file=./components/UnitTest.cs title=\\\"Structure-Insensitive ❌\\\"\",\n    \"1[3],4[20:100],6[18:100],8[26:100],11[28:100],25[100],14:18\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Structure-Insensitive\",\n    \"❌\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1,20:25 file=./components/UnitTest.cs title=\\\"Behavioral ✅\\\"\",\n    \"1,20:25\": true,\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Behavioral\",\n    \"✅\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"file=./components/UnitTest.cs title=\\\"Writable ❌\\\"\",\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Writable\",\n    \"❌\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"file=./components/UnitTest.cs title=\\\"Do we always have to make tradeoffs?\\\"\",\n    \"file\": \"./components/UnitTest.cs\",\n    \"title\": \"\\\"Do\",\n    \"we\": true,\n    \"always\": true,\n    \"have\": true,\n    \"to\": true,\n    \"make\": true,\n    \"tradeoffs?\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nvar mockAttendee = Substitute.For<Attendee>(\\\"Joe\\\");\\n\\nvar mockSession = Substitute.For<Session>(initialAttendees);\\n\\nvar mockSessionProvider = Substitute.For<SessionProvider>(MockDb);\\nmockSessionProvider.FindMeetup(\\\"Unit Testing Talk\\\").Returns(mockSession);\\n\\nvar mockAttendeeProvider = Substitute.For<AttendeeProvider>(MockDb);\\nmockAttendeeProvider.FindByName(\\\"Joe\\\").Returns(new[] { mockAttendee });\\n\\nvar conferenceUnderTest = new Conference(\\n  \\\"NDC Sydney 2020\\\",\\n  mockAttendeeProvider,\\n  mockSessionProvider\\n);\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nmockSession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nmockSession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-csharp\",\n    \"metastring\": \"1:25 file=./components/UnitTest4.cs title=\\\"Yeah, we do. But should aim to minimise the #\\\"\",\n    \"1:25\": true,\n    \"file\": \"./components/UnitTest4.cs\",\n    \"title\": \"\\\"Yeah,\",\n    \"we\": true,\n    \"do.\": true,\n    \"But\": true,\n    \"should\": true,\n    \"aim\": true,\n    \"to\": true,\n    \"minimise\": true,\n    \"the\": true,\n    \"#\\\"\": true\n  }), \"// Arrange\\nvar initialAttendees = 10;\\n\\nRegister<IDataStore>(MockDb);\\nRegister<SessionProvider>();\\nRegister<AttendeeProvider>();\\nRegister<Conference>();\\n\\nvar joe = Save(new AttendeeBuilder().WithName(\\\"Joe\\\").Build());\\n\\nvar session = Save(new SessionBuilder()\\n  .WithName(\\\"Unit Testing Talk\\\")\\n  .OnDate(new Date(2020, 10, 16))\\n  .WithAttendees(initialAttendees)\\n  .Build());\\n\\nvar conferenceUnderTest = Resolve<Conference>();\\n\\n// Act\\nconferenceUnderTest.Rsvp(\\\"Joe\\\", \\\"Unit Testing Talk\\\");\\n\\n// Assert\\nsession.Attendees.ShouldContain(a => a.Name == \\\"Joe\\\"));\\nsession.Attendees.Count.ShouldBe(initialAttendees + 1);\\n\"))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(Desiderata, {\n    mdxType: \"Desiderata\"\n  })), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"Things we know about Unit Tests\"), mdx(\"ol\", {\n    style: {\n      textAlign: 'left'\n    }\n  }, mdx(Appear, {\n    mdxType: \"Appear\"\n  }, mdx(ListItem, {\n    marker: \"\\uD83E\\uDDEB\",\n    higlight: false,\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Unit\"), \" - a cohesive collection of one or more responsibilities\"), mdx(ListItem, {\n    marker: \"\\uD83E\\uDDEA\",\n    higlight: false,\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Unit Test\"), \" - a test of a behavior that is isolated from all other tests \"), mdx(ListItem, {\n    marker: \"\\uD83E\\uDDF0\",\n    higlight: false,\n    mdxType: \"ListItem\"\n  }, mdx(\"b\", null, \"Test Desiderata\"), \" - consider tradeoffs first then reach for tools \")))), mdx(\"hr\", null), mdx(Layout, {\n    mdxType: \"Layout\"\n  }, mdx(\"h1\", null, \"Unit Testing: Deconstructed\"), mdx(\"a\", {\n    href: \"https://unit-testing-deconstructed.emilol.com\",\n    alt: \"Unit Testing: Deconstructed\"\n  }, \"unit-testing-deconstructed.emilol.com\"), mdx(\"br\", null), mdx(QRCode, {\n    value: \"http://unit-testing-deconstructed.emilol.com/\",\n    mdxType: \"QRCode\"\n  })));\n}\n;\nMDXContent.isMDXComponent = true;"}},"pageContext":{"matchPath":"/*","isCreatedByStatefulCreatePages":false,"id":"920dde17-3e7c-5715-b5bb-140fb80b5406","slug":"","title":"Unit Testing: Deconstructed"}}}