fakeiteasy Questions

3

I'm working on a fun project for myself to learn blazor, a lot of core concepts and just general practice. I'm trying to implement logger extension for FakeItEasy to easier test Microsofts ILogger....
Nibelung asked 17/10, 2020 at 15:17

4

Solved

I'm using C# and I need to Test one of my methods that accept System.Net.Http.Headers.HttpRequestHeaders as a parameter. We're using FakeItEasy for the test. But it seems that the HttpResponseHead...
Therm asked 20/4, 2020 at 19:7

3

I am new to FakeItEasy and try solve a problem. I have a class public class Events { public List<Events> SaveEvents() { // Call to repository and return 1(success) or -1(fail) //If the ...
Zimmer asked 15/10, 2014 at 2:43

2

Solved

Using FakeItEasy, is there a way to fake the setter of a write only property? The interface I have to work with looks something like: Interface IMyInterface { String Foo { set; } } I have trie...
Gley asked 8/7, 2016 at 21:22

5

Solved

I'm trying to figure out how to use FakeItEasy with the HttpClient, given the following code: public Foo(string key, HttpClient httpClient = null) { .. } public void DoGet() { .... if (_httpCli...
Englebert asked 7/3, 2014 at 0:42

1

Solved

I'm currently a Moq user and I'm researching other mocking frameworks. When unit testing I frequently call _mock.VerifyNoOtherCalls() so I can be certain there are no unexpected interactions beyo...
Coagulum asked 26/10, 2018 at 9:55

3

Solved

I have a service faked using FakeitEasy and i am trying to call its method. Here is the Code var client = container.Resolve<MyService>(); A.CallTo(() => client.GetUserProfile(userName))...
Lennielenno asked 5/9, 2014 at 9:33

1

Solved

I am trying to use FakeItEasy to mock an interface defined in C# public interface IMyInterface { int HeartbeatInterval { get; set; } } In the F# test i do let myFake = A.Fake<IMyInterface&g...
Shirt asked 22/11, 2017 at 16:5

2

Solved

We have to implement a retry-mechanism. To test the RetryProvider, I want a fake of a class to throw exceptions on the first two calls, but return a valid object on the third call. Under normal c...
Delicacy asked 30/10, 2017 at 14:3

2

Solved

I want to setup my fake like this: A.CallTo(() => this.repository.Create(A<PersonModel>._)).Returns(XYZ); where XYZ is the same variable as was inserted at A<PersonModel>._ so if...
Mila asked 26/9, 2017 at 10:23

2

Solved

I have an interface to a factory used to create some data objects. interface IFactory { IData Create (string name, string data); } interface IData { // .... } class Data : IData { public Data...
Aligarh asked 6/11, 2012 at 17:12

3

Solved

I'm using FakeItEasy to fake some Entity Framework calls, to make sure a bunch of weird legacy database tables are getting mapped properly. I need to assert that a Customer with an Invoice matchin...
Chela asked 4/5, 2017 at 11:10

2

Solved

The application I am testing is full of events based on custom delegates, such as this: public delegate void NameChangedHandler(string name); public event NameChanged OnNameChanged; ... public voi...
Postnasal asked 16/10, 2012 at 19:20

2

I was attempting to use FakeItEasy recently but I wasn't able to create a Fake from a concrete class without working around many quirks. I tried the following: public class MyObject { public MyOb...
Willtrude asked 18/10, 2011 at 2:51

1

Solved

According to the FakeItEasy tutorial here the WithArgumentsForConstructor() extension method does not call the class constructor: // Specifying arguments for constructor using expression. This is ...
Garbers asked 1/5, 2016 at 21:57

3

Solved

I’m using xUnit, SubSpec and FakeItEasy for my unit tests. I’ve so far created some positive unit tests like the following: "Given a Options presenter" .Context(() => presenter = new OptionsP...
Contract asked 13/6, 2012 at 10:32

3

Solved

I have a test (code is below) to test that Method1 calls Method2. The exception I'm getting is The current proxy generator can not intercept the specified method for the following reason: - Sea...
Purport asked 11/7, 2014 at 16:41

1

Solved

Using NUnit 2.6.4 & FakeItEasy 1.25.2 to unit test a C# code in Visual Studio 2013 Community Edition The following test fragment executes as expected [Test] public void test_whatIsUpWithStrea...
Sharleensharlene asked 14/7, 2015 at 23:36

2

Solved

I would like to reset a Fake Calls History or ignore a Call. The fake asserted method is called in the Init method in the tested class constructor and I want to ignore this call because it's not p...
Arletha asked 17/3, 2015 at 9:5

1

Solved

I'm trying to proxy calls to a fake object to the actual implementation. The reason for this is that I want to be able to use the WasToldTo and WhenToldTo of Machine.Specifications which only works...
Unavoidable asked 13/1, 2015 at 14:30

1

Solved

The screenshot says it pretty much. I have the overloads as seen in the screenshot. When using a string as second parameter the compiler should figure out that the first argument can only be a Func...
Buy asked 12/1, 2015 at 12:22

1

Solved

Unit tests that use FakeItEasy randomly fail when trying to fake a simple intefrace. It occurs in different tests occasionally and is not stable. Here is a sample interface I need to fake: publi...
Raspberry asked 22/10, 2014 at 7:1

2

Solved

I have the following call in my code: var dbResults = new List<CrossReferenceRelationshipEF>(); dbResults = dateTimeFilter == null ? new List<CrossReferenceRelationshipEF>( CrossRefe...
Brunei asked 29/1, 2014 at 16:35

1

Solved

I wonder if there is anyway one can fake up a generic method call, for all possible types (or specified sub-types)? For example, suppose we have this wonderful IBar interface. public interface IB...
Vaseline asked 4/4, 2014 at 14:40

2

Solved

How can I mock/facke the result from a function that is called in another function? Usually Test2 would be a DataAccess method that I dont like to fetch real data. What I like my unittest to test i...
Upsweep asked 12/2, 2014 at 16:34

© 2022 - 2024 — McMap. All rights reserved.