fakeiteasy Questions

2

Solved

How to check whether a Func has been called using the FakeItEasy framework? Example: Func<bool> myFunc = () => true; // Unfortunately this fails: A.CallTo(myFunc.Invoke()).MustHaveHappe...
Squashy asked 5/12, 2013 at 12:2

2

Solved

We are considering using FakeItEasy to be our mocking framework. To conduct a workshop for the team on FakeItEasy, I am looking for a good tutorial that explains this framework in much deta...
Allograph asked 21/9, 2013 at 6:51

2

Solved

What is Dummy used for in FakeItEasy? How does it differ from A.Fake or A.Ignored ? Thanks :-)
Loden asked 18/10, 2011 at 0:36

2

Solved

Using FakeItEasy, how do I check to see if my object's method calls another method on this same object? The Test: [TestMethod] public void EatBanana_CallsWillEat() { var banana = new Banana(); ...
Marathon asked 29/7, 2013 at 16:54

3

I'm using a controller extension, and I tried to mock it using FakeItEasy (v 1.7.4) like this: A.CallTo(() => controller.RenderView(A<string>.Ignored,A<object>.Ignored,null)).Return...
Lorielorien asked 30/1, 2012 at 13:24

2

Solved

For my test, I need the first call to a stub to return one object, and the next call to return a different object. I have seen this in other mock object frameworks in record() blocks, but I have no...
Wellmannered asked 6/3, 2013 at 16:51

2

Solved

I have the following interface : public interface IOuputDestination { void Write(String s); } In my unit test, I mock it like so : var outputDestination = A.Fake<IOutputDestination>(); ...
Olga asked 19/10, 2012 at 18:51

1

Solved

I'm trying to unit test a "service layer" / "application facade layer" method. This is the method I'm trying to unit test: // Create a new order in the database for a customer. Given a customer id...
Quartern asked 18/12, 2012 at 16:23

4

Solved

I'm trying to write a unit test of a repository implementation. The repository uses RavenDB as a database. For the unit tests, I would like to mock the RavenDB parts. In order to create the mocks (...
Plash asked 26/9, 2011 at 18:13

2

Solved

Moq allows mocking protected virtual members (see here). Is it possible to do the same in FakeItEasy?
Richella asked 18/3, 2011 at 11:32

1

Solved

I'm trying to do something along the lines of: A.CallTo(() => fakeTimer.Start()).Invokes(() => fakeTimer.Elapsed += Raise.With<ElapsedEventArgs>(ElapsedEventArgs.Empty).Now); The f...
Concavoconvex asked 24/7, 2012 at 14:25

1

Solved

I need to verify that a method was called with an object of a specific type this is the interface with the method that I want to test that it was called: interface IPlayer { void Send(object mes...
Dorsad asked 19/7, 2012 at 15:48

1

Solved

When i try to fake a delegate-type, i get System.InvalidCastException [TestMethod] public void TestDelegateFake() { var func = A.Fake<Func<long, object>>(); A.CallTo(() => func(A...
Godber asked 17/7, 2012 at 8:21

1

Solved

I am having an issue where a FakeItEasy call in an extremely simple test is failing with the error "The specified object is not recognized as a fake object." The call is simple: A.CallTo(myService...
Ambriz asked 5/4, 2012 at 18:16

2

Solved

I have a fake class that contains an event. My code should subscribe to that event and I want to test that. I'm using FakeItEasy with NUnit and I'm looking for a way to check that my code actually ...
Fredricfredrick asked 21/12, 2011 at 15:5

1

Solved

Using FakeItEasy, I am trying to capture the setting of a property value on a fake object: First the interface: interface ISomeInterface { int MyProperty {get;set;} } Then a fragment of unit t...
Ireful asked 26/10, 2011 at 18:57

4

Solved

I stumbled upon this open source project Fake It Easy, and I have to admit, it looks very interesting, however I have my doubts, what are the difference between FIE fakes and say Moq Mocks? I...
Stool asked 22/10, 2010 at 21:28

2

Solved

I have been using Moq for my mocking needs the last years, but after looking at FakeItEasy i wanted to give it a try. I often want to test that a method have been called with the correct parameter...
Rummer asked 20/8, 2011 at 16:49

1

Solved

I have a method that has an out parameter that returns a number of records. I would like to know how to mock it with FakeItEasy.
Koger asked 30/3, 2011 at 21:34

1

Solved

I have a method which I am testing. Given certain inputs, it should write a failure method to the logger (an ILogger). The interface has several overloads for Log(), as well as some properties (ex....
Shaving asked 9/3, 2011 at 15:3

1

Solved

Does anyone know the equivalent of Moq It.IsAny<T> in FakeItEasy ? I want to do assert that a method was called with an instance of a Type v.Do(new Foo()); I tried: A.CallTo(() => v.D...
Howlend asked 10/12, 2010 at 14:19

© 2022 - 2024 — McMap. All rights reserved.