Add support for TUnit Class Constructors#1362
Conversation
|
@SimonCropp - tested in version 28.4.0 - works as expected - Thanks! |
|
@SimonCropp - on further testing, I've run into a potential default file It seems that the file name is named per the If my test class is as follows: [ClassConstructor<DependencyInjectionClassConstructor>]
public class TestHandler(IAaa aaa, IBbb bbb, ICcc ccc)
{
[Test]
[Arguments(true, true, false)]
[Arguments(true, false, true)]
public async Task MyTest(bool arg1, bool arg2, bool arg3)
{
Verify("true");
}
}I'll get two files named: When I'd expect the file to be: Does this make sense - and are my expectations correct - the file shod be named from the test arguments, not the handler class constructor arguments? Am I missing anything? |
|
i would have though the file name should be the combination of the args from the constructor and the args from the test method? |
|
Possibly in some scenarios. From a DI perspective the constructor args are just DI service pointers, so won't provide any useful values in the context of the test. Perhaps if the types of the constructor args are value types, but not interfaces it might make sense? Given the example above, it seems though that the values of the test method arguments are being appended to the names of the constructor args in the equivalent positions, but not the names of the methods args, so something seems amiss. Is any of this behavior configurable? Thanks for engaging in this. |
|
@SimonCropp just following up |
https://github.com/orgs/VerifyTests/discussions/1360