Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Andrius Bentkus
    how would it work with a console application?
    literally just a console application and that is it?
    Jake Ginnivan
    If you can make it clearer, feel free to submit a pull request
    Yeah, shouldly does magic with stack traces to find the first method not inside shouldly and then reads the code before the extension method to make the error message
    Andrius Bentkus
    that sounds slow
    so it distinguishes between xunit, nunit, visual studio testing and when none of them is present?
    basically moves methods up until it finds the a method with a Test/Fact/whatever attribute from the specific unit testing framework?
    Jake Ginnivan
    Relatively speaking, yes, but the magic probably means an extra 10-20ms. And most only happens when there is a failure
    We just throw an exception, so no direct integration needed
    Andrius Bentkus
    that is true
    Jake Ginnivan
    Basically, it's the same as doing this `if(actual != expected) throw new Exception (actual + " does not equal " + expected);
    But awesome error messages
    Hello all, I am facing an error while opening the solution "one or more projects in the solution were not loaded properly". I am using VS2015 community edition. are there any prerequisites to open the solution. Can someone throw some light on the issue i am facing ?
    Paulo Morgado
    Hi! Any chance of addressing #471 ?
    Is anyone else getting loads of tests failing with the latest master? I had a little look and it seems to be due to .netcore not fully defining the stack trace.
    After a bit of a play, it looks like most of them will work if then run on .net45 (by removing the reference to .netcore), or including DiaSymReader files in the bin folder (as detailed here dotnet/corefx#21079). Is anyone looking at fixing this?
    Alex Allen

    Hey guys, I'm a little stuck in figuring out how to get a more helpful message than "False should be True but was not".

    Running xUnit, in a netcoreapp2.0 app, executing the tests in Rider 2017.3. Shouldly 3.0.0

    I believe the PDB settings are correct and are being generated. I don't know how to proceed.

    @lxalln I'm not sure if it is related to my problem above, but the .netcore stuff seems to have lost the stack trace source information, and this is what is used to determine the variables used in the should statements
    Alex Allen
    That's interesting. Is there an issue for this? I was under the impression that the stack trace info was back with .net core 2?
    Alex Allen
    @whortleberrybearer checking the code out from master leaves me with the same issue. 350+ failing tests.
    Looks like @JosephWoodward put some work in recently into .netstandard tests, and the builds appears to be working on appveyor.
    Alex Allen
    @whortleberrybearer I've managed to get a build locally that passes all of the tests. By switching the PDB generation from full to portable when running as netcoreapp2.0.
    Alex Allen
    I put in a PR that I think fixes this issue #488
    Ah, excellent. Nice work.
    osama arif lone
    hey iam new hello all to the people who mantain this wonderful place known as open source. I recently wanted to help out as well. Although i have worked in .net mvc and .net core before i have never handled and contributed in an open source project and as such i am quite lost with the overwhelming number of files and the number of errors that it is giving me when i build the solution on linux, using dotnet core 2.0. one of them being OmniSharp.MSBuild.ProjectLoader
    Project Shouldly is not compatible with net452 (.NETFramework,Version=v4.5.2). Project Shouldly supports:
    • netstandard1.3 (.NETStandard,Version=v1.3)
    • netstandard2.0 (.NETStandard,Version=v2.0)
    so should i remove 4.5.2 as the target framework ?
    osama arif lone
    hey there are many problems i am facing with just getting the entire solution to compile on my dotnet core 2.1.101 and when i downloaded the solution and tried it on windows with visual studio it said incomplete project files. Note i have the latest 15.6 build of visual studio and also i am on the latest version of dotnet core
    Uri Goldstein
    Hello. May I suggest that shouldly/shouldly#373 be closed as "not a bug"?
    Kevin Hahn

    Hey, I'm testing out shouldly, and it's throwing exceptions but it doesn't seem to be taking any info from the pdb like it should be. I've tried building it with full debug info with symbols on, and I've done it with no debug info, I don't get a warning or anything. For reference this is what I'm using to test it:

    var str = "hello world";

    And the exception I'm getting looks like this

    Shouldly.ShouldAssertException : 11
        should be
        but was not

    From what I've seen of the samples it should be included that I'm testing against str.Length

    Peder Husom
    Hi. Having problems with shouldly not finding the StackFrame it seems - any tips on why this is not working? Works fine on my windows box. Seems to only be when running on ubuntu/mono; https://travis-ci.org/hayer/GitVersion/jobs/379026458
    Error at line 3267
    Peder Husom
    After more googling and looking around I suspect that I might be waiting for this; shouldly/shouldly#496 ?
    Nick Gallimore
    Hi guys. I have made an open source extension method that uses Shouldly. It asserts that the Body of an IHttpActionResult response for a .NET api has some expected fields. Right now it's called BetterBe. But it is pretty cool. Here is the link to the project. It is called RIDGID.Common.Api. The above picture is what you can do with it. This is just an idea blossoming at the moment. But I think there would be a cool feature in store for Shouldly where it would work on ActionResult's for API's. It would deserialize the body and whatnot then do reflection over the object and assert that the value is what is expected.
    For example:

    Right now it is baked into a error message project that adds error ID's to responses: https://github.com/RIDGIDSoftwareSolutions/RIDGID.Common.Api

    The actual main logic of the file is here though: https://github.com/RIDGIDSoftwareSolutions/RIDGID.Common.Api/blob/master/src/RIDGID.Common.Api.TestingUtilities/ActionResultBetterBeExtension.cs

    If you are interested please email me nfgallimore@gmail.com
    Niklas Schilli
    Hey guys/gals
    I just came here from https://up-for-grabs.net to help out with some open source projects, and shoudly is one we also use in our company. When coming here there were several issues open and tagge as jump-in, but most issues were already solved. If you are searching for people to contribute, I would be grateful if you could do some house keeping and close already implemented issues which are marked as Jump-in. This would decrease the amount of overhead from people willing to contribute but unwilling to sift through every issue to check whether it has been implemented
    Andrey Yulsky
    Hi guys, someone has information about release date?
    Thomas Thiry
    Hello, I've been using Shouldly for some time now, but lately with my (dotnet core) projects the failure messages are not as good as before. The name of the variable is not put anymore in the message.
    for example for
    employee.FirstName.ShouldBe("John"); // fails
    --> message: "Dale" should be "John" but was not
    My question: is that on purpose or did I miss something? This is not in line with the documentation I think.
    (it kinda diminishes my point when I try to convince people to use it :-) )
    osama arif lone
    hey guys i am doing my masters in Pakistan does anybody know of a job or an internship that i can do remotly from Karachi ? Any help would be greatly appreciated.
    Alan Singfield
    Hello, I've open-sourced a utility for generating Shouldly tests, it's at: https://github.com/alansingfield/UnitTestCoder
    Hi, I am a .NET developer, working mostly on commercial apps, and I would also like to contribute to open source. I think shouldly is very nice project, I like the assertion syntax you invented. Can you recommend any issue which I could help you with? It would be my first open source PR.
    is anyone familiar with the subsection of the Shouldly src that has to do with formatting the exception string messages and embedding the appropriate values in a context-appropriate way? And particularly with grabbing stack trace manipulation
    Gabriel Milani
    Someone here to answer a question about the project?