dependabot[bot] on npm_and_yarn
Bump prismjs from 1.25.0 to 1.2… (compare)
jeremydmiller on gh-pages
Documentation Update for 6.1.0 (compare)
Hawxy on gh-pages
Documentation Update for 6.1.0 (compare)
github-actions[bot] on v6.1.0
Hawxy on master
Move to package license express… (compare)
dependabot[bot] on npm_and_yarn
Hawxy on master
Bump nanoid from 3.1.30 to 3.2.… (compare)
Hawxy on master
v6.1.0 (#103) * Minor code + d… (compare)
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();
});
}
}
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
IScenarioAssertion