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

C#

DevOps with EF Code-First (Or uh oh, don’t do what I just did)

July 11, 2017 by abel 3 Comments

When writing LoECDA.com, we (#LoECDA) wanted to build the site using modern technologies implementing best DevOps practices.  LoECDA.com is written using asp.net core, running in a Docker container, connected to a SQL Server database, all hosted in Azure with a full DevOps pipeline implemented in VSTS.  Each developer check in can flow into our different … [Read more…]

Posted in: Code Tagged: #RubDevOpsOnIt, C#, context.EnsureCreated(), context.Migrate(), Database DevOps, devops, Entity Framework Code First, LOECDA

The perils of being a lazy programmer (or, after all these years my dumb ass finally learned how to write a true Repository Pattern)

July 6, 2017 by abel Leave a Comment

I don’t even know what a Repository Pattern is! I’ve been super lucky in that writing code has never been hard for me.  Learning languages, picking up concepts, all that algorithm nonsense… when it comes to code, things just come pretty easily to me.  However, that has made me a lazy programmer which comes back … [Read more…]

Posted in: Code, Uncategorized Tagged: .net, C#, ef, EFCore, Entity Framework, Repository Pattern, Unit Of Work

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

Can I test private methods with MSTest?

April 17, 2015 by abel Leave a Comment

As a good little developer, I try to write unit tests for every line of code that I write.  But what about private methods?  Can I write unit tests against private methods?  If you are using MSTest, absolutely you can. Just use the PrivateObject class.  For instance, If you have this class:

C#
1
2
3
4
5
6
7
public class CalcLib
{
    private int MyPrivateAdd(int lhs, int rhs)
    {
        return lhs + rhs;
    }
}

You can … [Read more…]

Posted in: Code, Uncategorized Tagged: C#, Private Method, Unit Test, Visual Studio

Recent Posts

  • Working with GitHub Actions Output Parameters
  • Manually Trigger Actions Workflow in GitHub (How did I not know about this????)
  • Real World DevOps-Breaking It All Down (part 3-Setting up HTTPS)
  • Real World DevOps-Breaking it all down (part 2-Setting DNS)
  • Real World DevOps–Breaking it all down (part 1–Provisioning and Restoring DB’s from backup)

Recent Comments

  • Krisha on Getting Visual Studio Code Analysis and Code Metrics in an Azure Pipeline Build (part 1)
  • vinay on PowerShell Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send
  • Matt Olson on Getting Code Coverage info for a .net core app in Azure Pipelines
  • Howard on Containers, Kubernetes and DevOps for an Old as Dirt Developer (Or DevOps Nirvana with Kubernetes), Part 2/6
  • Howard on Containers, Kubernetes and DevOps for an Old as Dirt Developer (Or DevOps Nirvana with Kubernetes), Part 2/6

Archives

  • July 2020
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • May 2019
  • April 2019
  • 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 © 2021 Life According to Abel.

Magazine WordPress Theme by themehall.com