I am trying to mock the below method but the updateRefundReqeust returns null instead updated record. Unit test and Mocking method Is something ...
I am trying to mock the below method but the updateRefundReqeust returns null instead updated record. Unit test and Mocking method Is something ...
I want to mock the GreetingMessageHandler class in C# with Moq and Nunit in Visual Studio 2019 (version 16.8.4) And the Test trying to solve is to ...
I am following this intro to unit testing tutorial. I have not implemented a logic to determine what credit score should return "Maybe", "Declined" b ...
I have a class in which there is a parameter less constructor. But when this constructor is called, there are five properties of the class that gets v ...
I am new to MoQ framework. I am writing unit testing for controller using MoQ framework and here is my test method, Here is my Controller Method, ...
I want to test my code which is depend on Microsoft logging and i want to mock it or by pass it. in this method i am validating the input. it gives m ...
I've got these two lines on my code. Now, I'm creating a unit test. Both Objects, customer and employee are protected so I need to mocked them. I' ...
Here's my code: And my Unit Test code: But it still calls the original method and not the mocked one. Both classes exist in same assembly. I ha ...
I currently have the following method with code: With the following testcode calling it: When I call the mock object's host and port in the actu ...
I have the following controller The IProviderRepository looks like this. I have to MOQ the controller apparently.I am guessing that means I ahve ...
How to write unit tests for repository layer in domain driven design architecture using moq framework? My Repository class is as following. In thi ...
I am new to both MOQ and TDD / Unit Testing. I find myself repeating a lot of the same code in my "Arrange" section of each test method and it seems t ...
I'm facing a strange problem related to AutoFixture and AutoMoqCustomization and how it deals with automocking of concrete classes. I suspect that I'm ...
I need to unit testing this GetData method. this method needs a XmlElement parameter. how do I mock it? in my code, I first created a xmlDocument, ...
How can I tell Moq to expect multiple calls so I can still use the MockRepository to VerifyAll, as below? I know you can do this at verify time, bu ...
How do I mock something that is - Expression> using Moq? I'm trying to mock a call to my repo layer that takes in a LINQ Expression for constructi ...
I am trying to mock a method which takes two parameters, the signature of method looks as follows: I want this method to return something only if t ...
When I create my moq mock and try to pass it into my class constructor I get this message: Argument type Moq.Mock<...mockIAppCache> is not assin ...
I'm working on some code that follows a pattern of encapsulating all arguments to a method as a "request" object and returning a "response" object. Ho ...
Consider the following, where I am testing that an injected dependency's method is called a specific number of times: [Fact] public void WhenBossTal ...