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
Luke Marlin
@LukeMarlin
An extension method on string in FakeItEasy.Tests.TestHelpers.StringAssertionExtensions that would check that string matches ignoring linefeed?
What would be the best way, replacing all /r/n with /n, the check that the resulting strings are equal, or going through them via a loop to avoid "duplicating" the strings?
Blair Conrad
@blairconrad
Oh, I wouldn't worry about duplicating the strings.
Maybe this is short-sighted of me, but I'd consider taking the expected value and replacing \r?\n with System.Environment.NewLine, then comparing.
Or I suppose \r\n|\r|\n with System.Environment.NewLine. Or is this even necessary? I've been out of the Mac game for a while. Bare \rs have gone out of fashion, right?
Ah. Seems we switched over about 19 years ago. Probably no need to worry about it then.
Luke Marlin
@LukeMarlin
Alright, looking at fluentextensions API then. Looks like vscode's intellisense doesn't want to work today so it will be fun
Blair Conrad
@blairconrad
Oh, sorry. I think you want the extensions on StringAssertions. That matches what we did with BeAnExceptionofType.
... and VS is not responding, so I'll be delayed in confirming!
Luke Marlin
@LukeMarlin
Yep I'm already ther$
there
I looked at BeAnExceptionOfType as mentionned
Blair Conrad
@blairconrad
:+1:
Luke Marlin
@LukeMarlin
Seems like you guys have an extension method AsTextBlock on IEnumerable<String> that uses \r\n. Did you aim on using that instead of verbatims at some point?
If yes, it can just be a tweak to that method, and use it everywhere there are verbatim. Might be easier than finding a name to the new FluentAssertion I'm trying to write, what do you think?
It's also possible to replace the 3 occurences of that method by verbatims, whatever you think makes the most sense
Luke Marlin
@LukeMarlin
(Sorry for asking that much questions before contributing, I'm a complete stranger to FakeItEasy, as well as FluentAssertions :) )
Thomas Levesque
@thomaslevesque
I wasn't aware of that method. It must be pretty old.
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).