Git Product home page Git Product logo

typemockencodingexample's Introduction

Unfakeable Types and Updating Code

Agenda

  1. mscorlib
    Fakeable types via Typemock (below) or experience a TypemockException.
  2. Gist.
    http://bit.ly/2ieJbl1
  3. Scenario.

Scenario

We need to make a small update within a much larger set of functionality:

  1. How do we test that change?
    Test the smallest slice of functionality as possible.
  2. How do we make that change?
    Write a test that verifies the behavior or confirms the bug, then make updates.

Typemock and mscorlib

http://www.typemock.com/mscorlib-types

Typemock Isolator supports the following types within mscorlib:

  • System
    • DateTime
    • Environment
  • System.IO
    • File
    • Directory
    • FileStream
  • System.Security.Cryptography.X509Certificates
    • X509Certificate

Exception with unfakeable types

TypeMock.TypeMockException : *** Exception throw while recording calls. Please check:

  • Are you trying to fake a field instead of a property? try to set field or use Isolate.Invoke.StaticConstructor
  • Are you are trying to fake an unsupported mscorlib method? See supported types here: http://www.typemock.com/mscorlib-types InnerException ----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. ----> System.ArgumentNullException : String reference not set to an instance of a String. Parameter name: s

typemockencodingexample's People

Watchers

James Cloos avatar Ryan Rodemoyer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.