Life According to Abel
  • Home
  • Videos and Media
  • Presentations
  • Pics/Bio
  • About
Life According to Abel
Menu
  • Home
  • Videos and Media
  • Presentations
  • Pics/Bio
  • About

Shim UpdateModel

Using Microsoft Fakes, how do you fake a method with generics? (Mocking UpdateModel() )

June 8, 2015 by abel Leave a Comment

Using MSTest and Fakes as my mocking framework,  I was writing unit tests against an MVC controller and I needed to mock Controller.UpdateModel<TModel>(TModel).  How do you do that?  How do you fake out methods with generics?  In my example, in my controller action,  I’m pulling a Series object from my repository and I want UpdateModel() … [Read more…]

Posted in: Code, Uncategorized Tagged: C#, Fake, Fake UpdateModel, Generics, Mock, MockUpdate Model, Shim, Shim UpdateModel, Unit Test, UpdateModel

Recent Posts

  • How to best use Azure DevOps release pipelines with microservices?
  • The Dynatrace Unbreakable Pipeline in VSTS and Azure? Bam!
  • Trying to write Async Release Gates for VSTS using Azure functions? Read this!
  • Containers, Kubernetes and DevOps for an Old as Dirt Developer (Or DevOps Nirvana with Kubernetes), Part 5/6
  • Containers, Kubernetes and DevOps for an Old as Dirt Developer (Or DevOps Nirvana with Kubernetes), Part 4/6

Recent Comments

  • Eddie Frederick on Trying to write Async Release Gates for VSTS using Azure functions? Read this!
  • Stephen on Deploying DB’s in your CI/CD pipeline with EF Core Code First
  • Praylin Sam on The Dynatrace Unbreakable Pipeline in VSTS and Azure? Bam!
  • Morten Olsson on Containers, Kubernetes and DevOps for an Old as Dirt Developer (Or DevOps Nirvana with Kubernetes), Part 5/6
  • Bal on Containers, Kubernetes and DevOps for an Old as Dirt Developer (Or DevOps Nirvana with Kubernetes), Part 3/6

Archives

  • January 2019
  • August 2018
  • July 2018
  • June 2018
  • April 2018
  • January 2018
  • December 2017
  • November 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • December 2016
  • October 2016
  • May 2016
  • April 2016
  • February 2016
  • January 2016
  • October 2015
  • August 2015
  • June 2015
  • May 2015
  • April 2015
  • August 2014
  • July 2014
  • May 2014
  • April 2014
  • August 2010
  • July 2010
  • May 2010
  • September 2009
  • August 2009
  • July 2009

Categories

  • Code
  • Uncategorized

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Copyright © 2019 Life According to Abel.

Magazine WordPress Theme by themehall.com