Skip to content

Instantly share code, notes, and snippets.

@cyberhck
Last active April 16, 2020 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyberhck/e4771dea09a8ec5f0b4349f9f6896618 to your computer and use it in GitHub Desktop.
Save cyberhck/e4771dea09a8ec5f0b4349f9f6896618 to your computer and use it in GitHub Desktop.
part of medium class, look at https://gist.github.com/cyberhck/e142b7b94fd939691f67a6d3342094b1 for all classes
namespace Tests
{
public class BadClassTest
{
[Test]
public void TestGreetDoesNotThrowException()
{
var unit = new BadClass();
// var mock = new Mock<IService>(); (setup as well)
// use reflection to change the implementation under the hood, (unit._service = mock)
Assert.DoesNotThrow(() => unit.Greet())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment