Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 01 2016 16:24
    jeremymeng synchronize #617
  • Apr 01 2016 14:28
    blairconrad commented #490
  • Apr 01 2016 11:07
    blairconrad commented #629
  • Mar 31 2016 14:14
    PascalK starred FakeItEasy/FakeItEasy
  • Mar 31 2016 13:00
    blairconrad commented #490
  • Mar 31 2016 12:48
    drauch commented #490
  • Mar 31 2016 10:57
    blairconrad commented #617
  • Mar 31 2016 10:52
    adamralph commented #617
  • Mar 31 2016 10:42
    blairconrad commented #617
  • Mar 31 2016 10:41
    blairconrad commented #617
  • Mar 31 2016 10:29
    adamralph commented #617
  • Mar 31 2016 09:27
    adamralph commented #637
  • Mar 31 2016 08:29
    cecilphillip commented #637
  • Mar 31 2016 06:27
    M-Zuber commented #637
  • Mar 31 2016 06:25
    thecodejunkie commented #637
  • Mar 31 2016 06:25
    adamralph commented #637
  • Mar 31 2016 06:24
    adamralph commented #637
  • Mar 31 2016 06:13
    adamralph labeled #637
  • Mar 31 2016 06:13
    adamralph labeled #637
  • Mar 31 2016 06:13
    adamralph assigned #637
Blair Conrad
@blairconrad
Great question! Maybe. It looks like the sort of thing I would make up, and it's used in 3 tests, but never spread. Probably we forgot about it immediately after it was made.
I see your point. Join with Environment.NewLine. I'm agnostic. Either approach would be fine with me.
You calling me old?
Thomas Levesque
@thomaslevesque
And it's only used in one class
lol
Blair Conrad
@blairconrad
I'm headed back out to the garage. Will support whatever you guys decide.
And don't be sorry, @LukeMarlin. We welcome questions. I feel a little bad for you that things weren't set up right for you to tackle the issue you care about, but this movement toward supporting builds on Linux is kind of exciting to me.
Luke Marlin
@LukeMarlin
Yeah that would be the point, but @thomaslevesque said he wasn't comfortable with the way I first propose, which is basically the same thing as that method (except that it's reusable of course)
Thomas Levesque
@thomaslevesque

@LukeMarlin sorry if I wasn't clear. What I was uncomfortable with was this:

Alternatively, I suppose we could have the repo adjust its line endings to be native when checked out, but that makes me nervous.

Luke Marlin
@LukeMarlin
Ah, sorry
I understand why this was not comfortable then :D
What would be your take on the three options we've covered:
1) String.WithNormalizedLineEndings, and use normal assertions
2) Some custom fluentAssertion, but I cannot find a name that would be practical and clear (ideas?)
3) Reuse of that old method, with Environment.NewLine instead
Thomas Levesque
@thomaslevesque
I think option 2 is the cleanest
Not sure about the name... You could use the same names as the existing assertions, but with some meaningful prefix, I think
Luke Marlin
@LukeMarlin
The existing being Be, Match, or BeEquivalent, right?
Should().BeEquivalentExpectLineEndings()?
Blair Conrad
@blairconrad
Should().BeModuloLineEndings ?
I took out Equivalent because that already have a meaning in FluentAssertions
And I thought "Modulo" was more precise, although it might be more obscure
SecurIOTy
@SecurIOTy
Hi everyone; is this the place to ask FakeItEasy specific questions?
Blair Conrad
@blairconrad
It's a place. Welcome!
SecurIOTy
@SecurIOTy
Thanks :)
Blair Conrad
@blairconrad
Did you have a question, @SecurIOTy? If so, do ask. I'm stepping away from computers for probably an hour or two soon, but if there's a question here when I get back, I will for sure try to answer it!
SecurIOTy
@SecurIOTy
So I have an interface, IInterface that implements IInterface2 that has the same property name Property but IInterface implements that property with a new keyword modifier. FakeItEasy is having trouble keeping the value when it is cast from an IInterface to an IInterface2. Is there a FakeItEasy way to explicitly tell the fake to fake the IInterface2's property?
Sorry if it's confusing. Let me know if anything needs clarification.
Blair Conrad
@blairconrad
Code always helps, but if I understand right, and sorry if I don't, you probably want to at least specify additional interfaces for the fake to implement as in https://fakeiteasy.readthedocs.io/en/stable/creating-fakes/.
But the two properties are effectively two unrelated methods. You will have to set their values or configure their values separately.
Oh! One thing that does occur to me. After creating the Fake you might be able to configure one property to always return the value assigned to the other. e.g. (and I am not checking to see if this even compiles, but would later when I have time):
var fake = A.Fake<IInterface>(options => options.Implements<IInteface2>);
A.CallTo(() => ((IInterface2)fake).Property)).ReturnsLazily(call => ((IInterface)call.FakedObject).Property));
SecurIOTy
@SecurIOTy
Hmm I'll look into what you sent. I don't want to keep you. Thanks!
Blair Conrad
@blairconrad
But then assigning a value to IInterface2.Property later would undo that configuration (unless you configured the setter to write through to IInterface.Property similarly).
Oh, you won't keep me; I'll walk away regardless, but I'm happy to return to the question later.
If what I said doesn't apply, or just makes things worse, and you can share some sample misbehaving test code with a brief explanation, it's probably the best path to getting an answer.
SecurIOTy
@SecurIOTy
It WORKED
You're amazing @blairconrad
Blair Conrad
@blairconrad
Oh, wow. I did not see a notification for this, @SecurIOTy. I'm glad it worked. Happy FakeItEasying!
Blair Conrad
@blairconrad
Thomas Levesque
@thomaslevesque
Blair Conrad
@blairconrad
:tada:
Daniel Weinand
@devployment

Hello. I'm trying to create a fake of IOptionsMonitor<T>like this

var options = A.Fake<IOptionsMonitor<AllowedAppOptions>>();

A.CallTo(() => options.CurrentValue).Returns(new AllowedAppOptions());

As the faked object gets used by accessing CurrentValue I can see the following in the debugger

Method MetadataMethod(6000045 Microsoft.Extensions.Options.IOptionsMonitor`1::get_CurrentValue,0p) could not be resolved on type MetadataClassType(Castle.Proxies.ObjectProxy_3)

Am I missing something here or is it a general issue?

Thomas Levesque
@thomaslevesque
Hi @devployment
I haven't seen this before. Which version of FakeItEasy are you using? What's the target framework of your unit tests project?
Daniel Weinand
@devployment
Target framework is netcoreapp3.0. FakeItEasy is 5.4.0
Thomas Levesque
@thomaslevesque
Thanks. I'll see if I can reproduce it
Daniel Weinand
@devployment
If needed I can try to provide a minimal example later today.
Thomas Levesque
@thomaslevesque
When you say "I can see the following in the debugger", do you mean that the code executes correctly but prints this to the debug output?
Also, which version of Microsoft.Extensions.Options are you using? 3.0.0?