Smocks
Smocks copied to clipboard
Smocks is a library for mocking the normally unmockable. It can mock static and non-virtual methods and properties, amongst others.
I am getting this error when trying to setup a callback for a static method that has two int? arguments with default values of null. My static method looks like...
I have a static class with a single static method, but whenever I try to Setup a mock call to it, I get a NullReferenceException. If I write another method...
I would like to run multiple actions in a unique AppDomainContext. For example: execute a setup once and in the tests run Actions using previous Setup, sharing test context. I...
Is it possible to raise an event based on a type found by It.Is? Put an example in the test below. [TestCase] public void Raise_NonStaticEventBasedOnMatch_OriginalEventInvokesSubscribers() { int invocationCount = 0;...
I want to test like below static method. but `Method2` test is failed. __In app.dll__ ```cs namespace Sample.App { public static class SampleUtil { public static string Method1(IEnumerable ids) {...
Does Smocks support MSpec ? Below is my attempt at using it in MSpec. I'm getting a null reference error on the line that says `Smock.Run()`. ``` private Establish context...
I have try to use Smocks in a static method but it is throwing System.TypeLoadException exception. I have added the stack trace below. Is it the error on smocks or...
Hello genius, I'm currently using Smocks to isolate my c# unit test and mock up some static methods when run test. this is a great tool. No open source lib...
it would be interesting support async / await to be possible to test methods like this ``` C# Smock.Run(async context => { await target.Run(); } ```
We package and run all of our test assemblies at once using NUnit config like below ``` ``` With the above setup, when the NUnit initializes the AppDomain, its Directory...