About 19,200 results
Open links in new tab
  1. What is unit testing and how do you do it? - Stack Overflow

    Mar 16, 2009 · Also, Google for site:stackoverflow.com "how do you" unit-test I have read some questions on unit testing, but I don't exactly know WHAT it is or how you do it.

  2. c# - How do I use Assert to verify that an exception has been …

    How do I use Assert (or other Test class) to verify that an exception has been thrown when using MSTest/Microsoft.VisualStudio.TestTools.UnitTesting?

  3. Mock HttpContext for unit testing a .NET core MVC controller?

    I have a function in a controller that I am unit testing that expects values in the header of the http request. I can't initialize the HttpContext because it is readonly. My controller function e...

  4. How to unit test with ILogger in ASP.NET Core - Stack Overflow

    Apr 15, 2017 · How to unit test with ILogger in ASP.NET Core Asked 8 years, 8 months ago Modified 5 months ago Viewed 287k times

  5. What's the difference between unit tests and integration tests?

    A unit test is a test written by the programmer to verify that a relatively small piece of code is doing what it is intended to do. They are narrow in scope, they should be easy to write and …

  6. C# "internal" access modifier when doing unit testing

    Worth mentioning - you can often avoid the need for unit testing your internal methods by using System.Diagnostics.Debug.Assert() within the methods themselves.

  7. Setting HttpContext.Current.Session in a unit test

    Setting HttpContext.Current.Session in a unit test Asked 13 years, 9 months ago Modified 1 year, 7 months ago Viewed 218k times

  8. How can I write output from a unit test? - Stack Overflow

    182 Any call in my unit tests to either Debug.Write(line) or Console.Write(Line) simply gets skipped over while debugging and the output is never printed. Calls to these functions from …

  9. c# - Mocking HttpClient in unit tests - Stack Overflow

    Apr 5, 2016 · I have some issues trying to wrap my code to be used in unit tests. The issues is this. I have the interface IHttpHandler: public interface IHttpHandler { HttpClient client { get; } } …

  10. java - How to do unit test for Exceptions? - Stack Overflow

    Jul 22, 2010 · As you know, exception is thrown at the condition of abnormal scenarios. So how to analog these exceptions? I feel it is challenge. For such code snippets: public String …