• About
  • Privacy Policy
  • Utilities
Darchuk.NET

Mock

Angular HttpClient unit testing

November 23, 2018 by Robert 2 Comments

There’s several tutorials for how to use and test HttpClient, but I wanted to distill it down to a simple snippet that I can refer back to when I inevitably forget how to do it. via GIPHY HttpTestingController This handy thing is provided by importing the HttpClientTestingModule in to your TestBed.  It lets you manipulate … [Read more…]

Posted in: Angular, Asynchronous, Jasmine, Typescript, Unit Testing, Web API, Web Development Tagged: Angular, HttpClient, Mock, Testing, unit testing

Autofac.Extras.Moq AutoMock

March 23, 2018 by Robert Leave a Comment

Unit testing can be annoying.  Sometimes it feels like setting up a delicate house of cards in just the right way and hoping that nobody opens a window to let a breeze knock the whole thing over. If you’re using inversion of control (and you should be), its a little easier because you can use … [Read more…]

Posted in: .NET Core, C#, IoC, Unit Testing Tagged: AutoFac, C#, Mock, Moq, unit testing

Mocking TcpClient

January 19, 2018 by Robert Leave a Comment

Sometimes I want to unit test the pieces of my code that are close to the transport layer, but often they are so close to the metal that it is hard to separate them. There’s really not a great way to abstract out the communication layer, so you just have to bite the bullet and … [Read more…]

Posted in: C#, Unit Testing Tagged: C#, Mock, TCP, TcpClient, unit testing

Recent Posts

  • Allowing trailing JSON commas in ASP.NET Core 3
  • YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha
  • Logging in a .NET Core 3 SignalR client
  • .NET Core 3 unit testing project sdk
  • .NET Core 3.0 Upgrade–New JSON Serializer Gotchas

Recent Comments

  1. Robert on C# Setting Socket Keep-Alive
  2. Oliver Schramm on C# Setting Socket Keep-Alive
  3. John Anderson on Waiting for a keypress asynchronously in a C# console app
  4. Ronald Garlit on .NET Core 3 unit testing project sdk
  5. Ronald Garlit on .NET Core 3 unit testing project sdk

Copyright © 2025 Darchuk.NET.

Omega WordPress Theme by ThemeHall