Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 17 01:34
    Hawxy commented #107
  • May 04 13:52
    nghhoese commented #70
  • May 02 17:13
    jasper-ci removed as member
  • Apr 25 13:44
    marcindruzgala opened #107
  • Mar 23 08:52
    AdaskoTheBeAsT commented #106
  • Mar 22 18:02
    AdaskoTheBeAsT opened #106
  • Feb 26 02:14
    dependabot[bot] labeled #105
  • Feb 26 02:14
    dependabot[bot] labeled #105
  • Feb 26 02:14
    dependabot[bot] opened #105
  • Feb 26 02:14

    dependabot[bot] on npm_and_yarn

    Bump prismjs from 1.25.0 to 1.2… (compare)

  • Feb 09 15:01

    jeremydmiller on gh-pages

    Documentation Update for 6.1.0 (compare)

  • Feb 06 12:41

    Hawxy on gh-pages

    Documentation Update for 6.1.0 (compare)

  • Feb 06 12:00

    github-actions[bot] on v6.1.0

    (compare)

  • Feb 06 10:29

    Hawxy on master

    Move to package license express… (compare)

  • Feb 06 10:29
    Hawxy closed #104
  • Feb 06 10:28
    Hawxy opened #104
  • Feb 06 10:17

    dependabot[bot] on npm_and_yarn

    (compare)

  • Feb 06 10:17

    Hawxy on master

    Bump nanoid from 3.1.30 to 3.2.… (compare)

  • Feb 06 10:17
    Hawxy closed #102
  • Feb 06 10:17

    Hawxy on master

    v6.1.0 (#103) * Minor code + d… (compare)

Jeremy D. Miller
@jeremydmiller
Looking at the published Nugets, you’re right. Looking at the main hosting Nuget, it's targeting netstandard2.0 and netcoreapp3.0
Jonathan Mezach
@jmezach
There might be value in sticking with netstandard2.0 to stay compatible with ASP.NET Core 2.x on .NET Framework
Jeremy D. Miller
@jeremydmiller
I think just what you said here. We’ll probably need to set up dependency version ranges though. I don’t think I did that the first time through.
I’ll have some time this weekend to go over the Nuget mechanics, then get this published if you two think it’s ready
Jonathan Mezach
@jmezach
As far as I am concerned it's good to go ;)
Now I just need to have some more packages start to support .NET Core 3.0 :P
Lauri Kotilainen
@rytmis
Functionality-wise, things look good to me. If we're confident that .NET Standard 2.1 is functionally equivalent to netcoreapp3.0 in Alba's particular case, then sure, why not go with that.
Jeremy D. Miller
@jeremydmiller
Thanks for all your work on this one.
Lauri Kotilainen
@rytmis
Yay! Thanks. 🙂
Jonathan Mezach
@jmezach
@jeremydmiller Thank you for letting us do this ;). Glad I could help out here.
Craig Quillen
@cquillen
Just getting started with Alba. Trying to test a Core MVC controller action.
It's failing with "bad request - invalid hostname"
Here is my SUT setup code:
       public async Task Test_Logging()

        {

            var builder = BusinessRulesEngine.Web.Program.CreateWebHostBuilder(new string[] { });



            using (var system = new SystemUnderTest(builder, typeof(Startup).Assembly))

            {

                await system.Scenario(_ =>

                {

                    _.Get.Url("/home/TestLogging");

                    _.ContentShouldBe("");

                    _.StatusCodeShouldBeOk();

                });



            }

        }
thoughts on why it doesn't like the hostname?
@jeremydmiller
Jeremy D. Miller
@jeremydmiller
I have no idea, I’ve never seen that before. Can you post the actual stacktrace? Something tripping up inside of AspNetCore itself I’d expect. Something in your code looking for the host name off of the HttpContext?
Craig Quillen
@cquillen
I actually just figured it out.
had mixed runtime refs between app and test projects.
added these to test.csproj
<TargetLatestRuntimePatch >true</TargetLatestRuntimePatch >
Jeremy D. Miller
@jeremydmiller
AspNetCore 2.*? I think that’s in the Alba documentation isn’t it?
Not an issue w/ AspNetCore 3.0 I believe
Craig Quillen
@cquillen
and <project sdk="microsoft.net.sdk.web"
yeah 2.2
i was also getting the multiple version warning during assembly binding
all better now
not sure about the docs. I'll look again.
now i'm getting authorization failures, but that I understand. I've not done anything to set an auth header for my test request.
pretty sure it's working
Jeremy D. Miller
@jeremydmiller
Cool, and feel free to yell back here about any holes in the docs
For 3.0, they changed things for Nuget references for AspNetCore yet again. Alba just targets netcoreapp3.0 and the references will float based on the runtime version now. Should soften up the exact problems you saw
Tomasz Jaskula
@tjaskula
Hey, I started to use Alba and it's really cool, however there is one thing I would like to ask for. BeforeEach actions passes in not fully initialized HttpContext. For example RequestedServices collection is uninitialized which would be useful in some cases. WDYT ?
Jeremy D. Miller
@jeremydmiller
That’s filled in by ASP.net Core itself as part of the request. That’s actually done by middleware in the execution pipeline
Tomasz Jaskula
@tjaskula
Ok, that means that there is no mean to resolve a service before the request ?
Jeremy D. Miller
@jeremydmiller
Not from the request’s own scope container. You can from the root application container
Tomasz Jaskula
@tjaskula
I have another issue as well, in some cases the HttpContext handed over to IScenarioAssertion has RequestServices == null. Is this something you've noticed ?
Jeremy D. Miller
@jeremydmiller
I can’t say that I have, no, but again, Alba itself depends on ASP.Net Core to deal with that. What are you needing to do? Why does it need to be the request scoped services?
Tomasz Jaskula
@tjaskula

I have this code to assert on GraphQL queries

public class SuccessResultAssertion : GraphQLAssertion
    {
        private readonly string _result;

        public SuccessResultAssertion(string result) => _result = result;

        public override void Assert(Scenario scenario, HttpContext context, ScenarioAssertionException ex)
        {
            var writer = (IDocumentWriter) context.RequestServices.GetService(typeof(IDocumentWriter));
            var expectedResult = writer.Write(CreateQueryResult(_result));

            var body = ex.ReadBody(context);
            if (!body.Equals(expectedResult))
            {
                ex.Add($"Expected '{expectedResult}' but got '{body}'");
            }
        }
    }

So I noticed that while executing tests only the first test has context.RequestServices filled, the scond tests throws an exception as RequestServices is null

GraphQLAssertion is abstract class implementing IScenarioAssertion
Jeremy D. Miller
@jeremydmiller
How is IDocumentWriter scoped? Can you not pull it out of the application services instead?
Tomasz Jaskula
@tjaskula
how can I access the application service container from here ?
Jeremy D. Miller
@jeremydmiller
Trying to figure that out myself;)
Sorry, gotta go finish getting kids ready for school. I’ll be back later today
Tomasz Jaskula
@tjaskula
ok, thanks :)
Jeremy D. Miller
@jeremydmiller
Wait, duh, it’s IHost.Services that you can get to off the SystemUnderTest
Tomasz Jaskula
@tjaskula
Ok so I'll have to pass it somehow to the assertion
Tomasz Jaskula
@tjaskula
After looking a bit, there is no mean I can access IHost.Services from inside the IScenarioAssertion. Scenario passed in to Assert method would need to expose the SystemUnderTests but it's not the case. It's kept internally
Jeremy D. Miller
@jeremydmiller
We could do a quick Alba 4.1 and add an overload of some kind to make it easier to do this kind of thing