Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
117 views

I have a class that looks like this: public int DoWork(int value) { return value + GetDataFromDB(); } public int GetDataFromDB() { return 10; } In the real world the second function goes ...
John's user avatar
  • 306
0 votes
0 answers
33 views

I'm trying to mock the return set in tableClient.QueryAsycn<TableEntity>(), but it continues to return empty lists. Is there anything glaringly obvious that I'm missing in my unit test. The ...
thinker's user avatar
  • 196
1 vote
2 answers
143 views

I'm working on an ASP.NET Core project, and I need to write an integration test that involves using SSL certificates. Specifically, I want to fake the LocalCertificate property in the integration test....
hojjat ghassemabadi's user avatar
0 votes
1 answer
71 views

In a PUT route, I have an utility method where we put the business logic (so we can call the method and not the route when we need to do the job that route does). I don't understand how can I fake the ...
Nahuel Berardi's user avatar
0 votes
2 answers
112 views

I'm using the DI container to create my fakes for integration testing. I'm calling this method for all the interfaces I need to fake in my ConfigureServices function in my Application factory: public ...
Antoine Brisebois-Roy's user avatar
0 votes
1 answer
187 views

I have a generic C# interface that I'm trying to mock with FakeItEasy for an xUnit test like this: #region FakeItEasyDebugging public interface IFakeTest<T> : IDisposable where T : new() ...
path's user avatar
  • 28
1 vote
1 answer
2k views

I have the function like this : public class myClass { public static string myFunction() { return "returnValue"; } } I want to fake myClass() using FakeItEasy. And I wrote: var ...
bobo's user avatar
  • 23
0 votes
0 answers
59 views

I am faking a service using FakeItEasy string phone = "123456"; var response = new VerifyResponse(); var fakeVerifyService = A.Fake<IVerifyService>(); var verifyCall = A.CallTo(() =&...
Isaac Ikusika's user avatar
0 votes
1 answer
444 views

I am trying to verify that data coming in the Detail property of an AWS ScheduledEvent object is correct. The information should be coming in from EventBridge with JSON in the Detail property that ...
TortillaCurtain's user avatar
0 votes
1 answer
92 views

I may doing something wrong but can't find the answer. It seems that line var searchFake = A.Fake<Search>(); should simply work. But it always gives me the error Constructor with signature () ...
Anton Shakalo's user avatar
-1 votes
1 answer
466 views

I'm trying to add FakeItEasy-based unit tests to a REST API controller of an ASP.NET core app. The public controller methods I need to test call the protected authorization methods implemented in the ...
Alek Davis's user avatar
  • 10.8k
0 votes
2 answers
632 views

I'm writing a unit test for ConsumerService that uses EntityFramework Core. Below you can see my AppDBContext class, and its one and only constructor. In order to fake it, I'm required to pass ...
user avatar
0 votes
1 answer
53 views

So, It seems I have arrived at an impasse. I have asked to write unit test for a legacy code base in .Net however I am frequently coming across code that is implementing the 'using' statement. This is ...
indrajit bagchi's user avatar
0 votes
1 answer
832 views

I am using the following line in my code to execute the stored procedure, var parameters = new DynamicParameters(); parameters.Add("MYPARAM", field.ListPickListCode, DbType.String, ...
tRuEsAtM's user avatar
  • 3,751
0 votes
2 answers
216 views

I have the following Interface & Class and I also wrote a unit test as shown down, but I got an exception: Assertion failed for the following call: AsyncConsole.example1.IPlayer.Start(i: 1) ...
Mike Bluer's user avatar
0 votes
1 answer
259 views

I have a simple WCF service that returns a list of PackagesModel.UnitTypeList to my ASP.NET MVC 4 controller [HttpGet] public ContentResult GetUnitType() { List<PackageModelUnitTypeList> ...
jdistro07's user avatar
  • 167
1 vote
2 answers
163 views

I have been writing unit testing for the API. I need to check whether values inside the model returned by the action method are expected or not. [Fact] public async Task ...
akhil's user avatar
  • 23
0 votes
2 answers
279 views

I'm developing an API which communicates with MongoDB and I need to create some statistics from one collection. I have the following service: public class BoxService : IBoxService { private ...
cs.kali's user avatar
  • 308
2 votes
1 answer
1k views

I have convereted my IEnumerable function into a (public async Task<List>) however im having issues fixing my unit test for that specific part. Im using fakeiteasy to mock my data, and assert ...
Omar Assouma's user avatar
4 votes
1 answer
914 views

I have a piece of code like this (simplified): await realApiClient.DoSomething(entity); entity.Email = newEmail; await realApiClient.DoSomethingElse(entity); In my test I have created a fake and want ...
JustAMartin's user avatar
  • 13.9k
0 votes
1 answer
375 views

I'm writing a unit test and therefore i need to fake an IMemoryCache. public MyUseCaseTest() { this.myCache = A.Fake<IMyCache>(); } When i run the test and the tested method is called, the ...
Thomas Meinhart's user avatar
0 votes
1 answer
204 views

I'm trying to fake a sealed external audio source using FakeItEasy. I've wrapped the audio source and successfully faked the wrapper, so I know the basics are right. Here's the bit I'm currently stuck ...
piersb's user avatar
  • 606
1 vote
1 answer
328 views

When attempting to supply a fake delegate for a method with an optional parameter in a faked object type MyType () = abstract B: ?s:string -> unit default x.B (?s: string) = Option.iter (...
OrdinaryOrange's user avatar
0 votes
1 answer
908 views

Using version 7.3.0 of FakeItEasy. In following code I am getting message that call to method GetById is not configured, yet I am configuring it. What I am doing wrong? There is no overload for the ...
epitka's user avatar
  • 17.6k
1 vote
1 answer
4k views

I'm developing an application with .NET Core and EF. I'm trying to implement some unit test using FakeItEasy and NUnit. Here's my problem. I've a DbContext as this one: public class PostgresDbContext :...
Miguel Andrade's user avatar

1
2 3 4 5
8