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 15:05

    jeremydmiller on gh-pages

    Documentation Update for 5.0.0 (compare)

  • Dec 02 15:03

    jeremydmiller on master

    doc updates for Alba 6 (compare)

  • Dec 01 16:52
    dhaligas opened #98
  • Nov 29 19:40

    github-actions[bot] on v6.0.0

    (compare)

  • Nov 29 19:16

    jeremydmiller on master

    adding .net 6 to the gh actions (compare)

  • Nov 29 19:15
    jeremydmiller closed #32
  • Nov 29 19:15
    jeremydmiller commented #32
  • Nov 29 19:14

    jeremydmiller on master

    customizations are applied thro… can use Alba web application fa… (compare)

  • Nov 29 17:28
    jeremydmiller closed #95
  • Nov 29 17:28

    jeremydmiller on master

    hardening the assertion excepti… (compare)

  • Nov 29 17:27
    jeremydmiller commented #95
  • Nov 29 17:06

    jeremydmiller on master

    Working WebApplicationFactory e… (compare)

  • Nov 29 17:06
    jeremydmiller closed #97
  • Nov 22 03:21
    Hawxy ready_for_review #97
  • Nov 20 11:19
    Hawxy opened #97
  • Nov 19 19:55

    jeremydmiller on master

    updated docs a tiny bit for rem… initial concept for using Alba … (compare)

  • Nov 19 19:55
    jeremydmiller commented #95
  • Nov 19 19:52
    jeremydmiller labeled #95
  • Nov 19 19:52
    jeremydmiller closed #83
  • Nov 19 19:52
    jeremydmiller commented #83
Jeremy D. Miller
@jeremydmiller
Cool, Joe is a former colleague of mine. He helped with Alba in the early days too
Tomasz Jaskula
@tjaskula
Oh, that's awesome. This world is so small
Do you think there is a chance for a release of Alba with this feature anytime soon then ?
Tomasz Jaskula
@tjaskula
@jeremydmiller I've opened the issue for reference JasperFx/alba#69
Jeremy D. Miller
@jeremydmiller
With me having 2 weeks off for Christmas, yes;)
Tomasz Jaskula
@tjaskula
I can do a PR if you prefer :)
Jeremy D. Miller
@jeremydmiller
I will very happily take that. If we expose IServiceProvider for the app off of the Scenario class it should make it easier to add declarative assertions. That’s my first thought
Tomasz Jaskula
@tjaskula
yep :)
that would be awesome
Tomasz Jaskula
@tjaskula

what I see as benefit as well is that on UT actions as here

[Test]
        public async Task SearchOneFondsQueries()
        {
            await Run(
                _ =>
                {
                    var input = new GraphQLRequest
                    {
                        Query = @"{ funds(searchQuery: ""Fond de Test Hedge en Duration"") { name } }"
                    };
                    _.Post.Json(input).ToUrl("/graphql");
                    _.StatusCodeShouldBe(HttpStatusCode.OK);
                    _.GraphQL()
                        .ShouldBeSuccess(@"{ ""funds"": [
                                            {
                                                ""name"": ""Fond de Test Hedge en Duration""
                                            }]}");
                });
        }

where Scenario is passed in into the Run function, I could add extensions method that would allow for me to retrieve a dependency, and configure expectations on it. Because for my test some fake dependencies are registered in within the test startup and initialized with SystemUnderTest.ForStartup<T>(builder =>... so that way I would have an easy way to retrieve them and set expectations based on test requirements

Jeremy D. Miller
@jeremydmiller
I’ll totally by that. What version of Alba are you using btw?
Tomasz Jaskula
@tjaskula
I'm using 3.0. because the last release is not compatible with standard 2.0
Jeremy D. Miller
@jeremydmiller
You can still use it with ASP.Net Core 2.*
the latest I mean. Took a lot of conditional compilation to make it happen of course. Multi-targeting asp.net core versions is rough right now with the churn
Tomasz Jaskula
@tjaskula
yes, our test project targets right now net472
Jeremy D. Miller
@jeremydmiller
Ah, shoot, okay. I think we gave up on ASP.Net Core < 2 in the latest
Tomasz Jaskula
@tjaskula
that's why, we have a lot of "legacy" dependencies, we cannot migrate it easily
Jeremy D. Miller
@jeremydmiller
I completely get it
Tomasz Jaskula
@tjaskula
ahhh
I understand maintaining old platforms is not easy for you
Jeremy D. Miller
@jeremydmiller
It is when the platform changes a lot in a few years
Ralph Hendriks
@ralphhendriks

@jeremydmiller I just started playing around with Alba for some HTTP API integration tests. So far, I like it a lot. One thing that bugs me though is that the built-in assertion on the content type behaves not as I would expect. I have configured my scenario _.ContentTypeShouldBe("application/problem+json"), which then fails with:

Alba.ScenarioAssertionException : Expected a single header value of 'content-type'='application/problem+json', but the actual value was 'application/problem+json; charset=utf-8'

Of course I can include the charset on the expected value. However, it feels a bit clunky to do so. I could make a contribution to improve this if you like, but I am not sure if this fits in your ideas how the library should develop.

Jeremy D. Miller
@jeremydmiller
A PR for this would be very welcome. I think you’d end up making hte content type check be a custom assertion so it can be smart enough to parse mime types
dionfoster
@dionfoster
:wave:
hi guys, i'm looking to use alba for integration testing of a dotnet core 3.1 api endpoint
it is using multipart/formdata with an IFormFile
i don't mind putting together a PR for this but need some help
first off, is there a way to view the raw request alba is sending?
Jeremy D. Miller
@jeremydmiller
Right now the answer is “debugger”. I’d happily take a PR if you want an optional sink to display the incoming request.
dionfoster
@dionfoster
:thumbsup:
dionfoster
@dionfoster
hey guys i've posted a PR for review to add support for multipart form data and IFormFile, hopefully a starting point for conversation on a few aspects
dionfoster
@dionfoster
feedback appreciated
Jeremy D. Miller
@jeremydmiller
@dionfoster I’ll get something to you tomorrow. It was on my TODO list in the morning, but I didn’t get to it
dionfoster
@dionfoster
no problems! thanks!
dionfoster
@dionfoster
depending on what is desirable from an api perspective, might need some implementation changes with regards to the formcollection as the only way i could get this going was to replace the entire formcollection on the HttpRequest
JT
@Hawxy
@jeremydmiller I know you're not focusing on alba right now, but would you accept a semver major maintenance PR that drops support for .net core 2.x and adds a .net 5 target with related test host?
Jeremy D. Miller
@jeremydmiller
Oh hell yes I would, and thank you!
JT
@Hawxy
#80 is up for review
Jeremy D. Miller
@jeremydmiller
@Hawxy Alba v4 is up on Nuget, and I’ve published the doc updates you did. Thank you so much for taking that on!
JT
@Hawxy
:thumbsup:
Ismail Mayat
@ismailmayat
is it possible to post ToUrl where the url has param [FromRoute] ?
Jeremy D. Miller
@jeremydmiller
ToUrl() is just passing the Url as a string, and it’s completely agnostic of what is handling that in your ASP.Net Core application. Long winded way of saying “yes"
Ismail Mayat
@ismailmayat
@jeremydmiller ah yes you are right, so i think the issue is something else basically i was writing a test for the Add method on this controller https://github.com/joaofbantunes/OOPsIDidItAgain/blob/main/src/OOPsIDidItAgain.06.MinimizingExceptions.Web/Controllers/CartsController.cs
it has input param AddItemCartModel which looks like https://bit.ly/2OWlYHx the ItemId field is another type and that is hydrated by https://bit.ly/3tn7oYo modelbinder and i think issue is here
Jeremy D. Miller
@jeremydmiller
Hey, if anybody is paying attention to this, here's a set of proposed changes for Alba V5: JasperFx/alba#86
The big driver is wanting helpers for testing APIs secured by JWTs post haste at my work
JT
@Hawxy
For JWT's we just have a fake JWT generator and override the JwtBearerOptions within the hostbuilder passed into the SystemUnderTest
 s.PostConfigure<JwtBearerOptions>(JwtBearerDefaults.AuthenticationScheme, options =>
                    {
                        options.TokenValidationParameters = new TokenValidationParameters
                        {
                            IssuerSigningKey = FakeJwtGenerator.SecurityKey,
                            ValidIssuer = FakeJwtGenerator.Issuer,
                            ValidAudience = FakeJwtGenerator.Audience
                        };
                    });
Although in our case our identity provider is Auth0, so I'm guessing there's some extra complexity when it comes to IdentityServer.