Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 02 08:38
    jnyrup edited #1754
  • Dec 02 08:37
    jnyrup labeled #1754
  • Dec 02 08:37
    jnyrup labeled #1754
  • Dec 02 08:37
    jnyrup opened #1754
  • Dec 01 19:58
    jnyrup closed #1752
  • Dec 01 19:58
    jnyrup closed #1753
  • Dec 01 19:58

    jnyrup on master

    Prevent multiple enumeration in… (compare)

  • Dec 01 19:47
    bert2 edited #1753
  • Dec 01 19:47
    bert2 edited #1753
  • Dec 01 19:42
    bert2 synchronize #1753
  • Dec 01 19:34
    bert2 synchronize #1753
  • Dec 01 17:37
    bert2 synchronize #1753
  • Dec 01 17:35
    bert2 edited #1753
  • Dec 01 17:35
    bert2 edited #1753
  • Dec 01 17:32
    bert2 opened #1753
  • Dec 01 07:24
    dennisdoomen commented #1752
  • Dec 01 07:24
    dennisdoomen assigned #1752
  • Nov 30 18:42
    bert2 commented #1752
  • Nov 30 18:20
    dennisdoomen commented #1752
  • Nov 30 18:20
    dennisdoomen labeled #1752
Jeff Yates
@somewhatabstract
Appears I was trying to build the tests as Release and it doesn't much like that
Jeff Yates
@somewhatabstract
Ah, even worse, something has messed up my install of .NETNative so it can't find the bits it needs
I'll repair VS tonight;should fix that
Dennis Doomen
@dennisdoomen
Did you try BuildPackage.bat to see if that properly builds
Jeff Yates
@somewhatabstract
The repair of VS seems to have fixed everything. I suspect that installing VS15 preview messed my install up a bit. The only thing I can't do is run the WP8 tests and I think that's because I don't have Visual Studio 2013 and the Windows Phone 8 emulators
Jeff Yates
@somewhatabstract
I've been working on the using method of resetting event monitoring, but for some reason, when I try running all tests (just the existing ones, no new ones), VS crashes. I cannot work out if it is because my code is broken, or I've hit a weird bug in VS or one of my add-ins.
I am not entirely certain what project's tests are the culprits, since it doesn't seem to happen if I try each one individually

Anyone have any thoughts?

This work does involve weak references and dispose pattern stuff so there's a chance that I've messed that up somewhere, though I would expect a slightly nicer error than VS crashing

Anders Abel
@AndersAbel
I'm looking at implementing an IEquivalency-step for the XML equivalency, but need some help to understand how it is registered. Looks like the EquivalencyStepCollection is initialized in the Core project, but the XML stuff is in Shared and in NET40/NET45. Are there any existing equivalency steps that are registered on a per framework basis?
I think moving the XDocument/XElement assertions to Core would be doable, but XmlDocument/XmlElement are only available in full .NET framework.
Dennis Doomen
@ddoomen_twitter
@AndersAbel No. That's kind of mew
Anders Abel
@AndersAbel
So doing this would require some refactoring to the entire equivalency setup?
Dennis Doomen
@ddoomen_twitter
@somewhatabstract You're using R# to run the unit tests
Anders Abel
@AndersAbel
Good, I'll look into that. (It's a bit embarassing, but I'm actually listed as a contributor to that file so I should know about it...)
Dennis Doomen
@dennisdoomen
Don't worry. These days, for every question on Twitter, Gitter and StackOverflow, I have to look up the code to answer. There's so much in it these days.
Jeff Yates
@somewhatabstract
I admit getting lost in the equivalency stuff
@ddoomen_twitter Yes, I am using R#. Is that the issue? I would not be surprised.
Dennis Doomen
@dennisdoomen
What can I do to help?
Jeff Yates
@somewhatabstract
I am not sure. I'm going to take another look tonight. Perhaps I will cut a PR for you to look at. If you can take a look at running the tests yourself or at least looking over the changes, you might see something I am missing
If you have time to do so, of course
(don't want to be volunteering your time; have enough trouble managing my own!)
Dennis Doomen
@dennisdoomen
I can try. Didn't bring my developer laptop to the US, so I might be missing some SDK.
Jeff Yates
@somewhatabstract
I am sure it can wait, if necessary. I took a break from it as I was getting frustrated. :D
I might see the issue myself tonight. I'm going to try running the tests outside of R# and see if that at least works
I hope you're enjoying your trip over here
I was mentally back in Europe this morning as I watched England and Wales
Liashenko Vladymyr
@LVladymyr
hi guys.
I've move fluentassertion to dotnetstandard but it looks like a sh.t. It`s no way to use dotnet core project with "shared" project together.
and this dotnet core compiler work not very well with define variables (or it is only in my environment)
if you have interest to prove it, you can find it here https://github.com/LVladymyr/FluentAssertions
Dennis Doomen
@ddoomen_twitter
@LVladymyr I'm not sure I understand what you're trying to say.
Liashenko Vladymyr
@LVladymyr
Sorry for my english.
I try to adaptate fluentassertion work with dotnet core, but my implemetation is not good enough.
New xproj can not work with "shared project"
Marcel Körtgen
@mkoertgen
Hi @dennisdoomen, i just created a PR that should resolve the json issues. Please have a look
Pavel Vostretsov
@fakefeik

Hi
I wanted to use FluentAssertions for object comparison with some properties left out. I have TMessage actual, TMessage expected, Expression<Func<TMessage, object>>[] leftOutProperties.
I've written such code:

actualMessage.ShouldBeEquivalentTo(expectedMessage, o => 
{
    foreach(var expression in leftOutProperties)
        o.Excluding(expression);
    return o;
});

and it works like a charm. But there is a problem: instead of an exception, I want to get List<ComparisonResult> from this method, where ComparisonResult contains object Expected, object Actual and Expression PathToProperty. Is there any simple way I could accomplish this? I've read documentation and I couldn't find one.

Dennis Doomen
@dennisdoomen
@fakefeik what do you mean with these comparison results? To evaluate the differences?
Pavel Vostretsov
@fakefeik

I mean that now I use it like this:

public string Compare<TMessage>(TMessage expectedMessage, TMessage actualMessage)
{
    try
    {
        actualMessage.ShouldBeEquivalentTo(expectedMessage, o =>
        {
            foreach (var expression in leftOutProperties)
                o.Excluding(expression);
            return o;
        });
        return null;
    }
    catch (AssertionException e)
    {
        return e.Message;
    }
}

What I want to be able to do is get rid of the try and return not a string, but some list of comparison results for pretty-printing it later, like this

public IEnumerable<ComparisonResult> Compare<TMessage>(TMessage expectedMessage, TMessage actualMessage)
{
    return actualMessage.ShouldBeEquivalentTo(expectedMessage, o =>
    {
        foreach (var expression in anyValuePaths)
            o.Excluding(expression);
        return o;
    });
}
I've looked through the code and it seems the easiest way is to write an extension method that would behave similar to ShouldBeEquivalentTo, but would use different AssertionStrategy
Although it seems to be quite difficult because there is no public constructor that takes AssertionStrategy as a parameter
Pavel Vostretsov
@fakefeik
Perhaps, there's something I'm missing?
Dennis Doomen
@dennisdoomen
No, not out of the box. What that requires is that the [AssertionScope] (https://github.com/dennisdoomen/FluentAssertions/blob/master/Src/Core/Execution/AssertionScope.cs) constructor supports an ambient assertion scope. I would welcome a PR ;-)
Pavel Vostretsov
@fakefeik
I don't quite get it what is an ambient assertion scope
though I think it is enough to make Dispose() virtual and assertionStrategy and contextData protected in AssertionScope
So I could create my own MyAssertionScope that inherits AssertionScope, override Dispose() and use it
Dennis Doomen
@dennisdoomen
The AssertionScope class uses a thread-static field to track the currently executing assertion to collect and throw them as one assertion exception. By creating an instance of that class, it assigns a new CollectingAssertionStrategy to that field. So we have two options to accomplish what you're asking for:
  1. Allow multiple assertion scopes on the current thread to share the collection strategy, but this would require some kind of reference counting
  2. Extend the ShouldBeEquivalentTo API to allow you to pass an alternative impleemntating of the IAssertionStrategy.
Dennis Doomen
@ddoomen_twitter
@onovotny @smudge202 I'm planning the work for Fluent Assertions 5.0. Any thoughts should go dennisdoomen/FluentAssertions#463
Saro Taşciyan
@SaroTasciyan
Heya Dennis, I was planning to take some time on up for grab issues on the following weeks. If you think there is anything I can help you with v5 please let me know
Dennis Doomen
@dennisdoomen
@SaroTasciyan don't let my plans for v5 hold you back. I won't be starting this before the end of September anyway. So if you find the time to pick up any of the up-for-grabs items, that would be awesome.
Saro Taşciyan
@SaroTasciyan
Good morning Dennis, it's great that we have plenty of time to improve stuff before the major release. Just wanted to let you know I would love to get involved in v5 as well ;)
Dennis Doomen
@dennisdoomen
Sure. By the time I'm going to start with that, I'll probably create a task list in the issue and a branch on the repo.