Summary
State<T>.ThrowIfNotTestAssembly in TimeWarp.State 12.0.0-beta.3 and 12.0.0-beta.4 throws FieldAccessException unless assembly.FullName.Contains("Test") (ordinal, case-sensitive).
Kebab-case test assemblies such as web-spa-integration-tests contain tests but not Test. A test that calls ThrowIfNotTestAssembly(Assembly.GetCallingAssembly()) fails even though it is a test assembly.
State.Initialize() itself no longer calls this guard. The failure is on the protected helper that template debug seeders use.
Expected
Treat the assembly name as a test assembly when it contains test using StringComparison.OrdinalIgnoreCase (or an equivalent check that accepts both Test and tests).
Actual
if (!assembly.FullName.Contains("Test"))
{
throw new FieldAccessException("Do not use this in production. This method is intended for Test access only!");
}
Repro
From a project whose assembly name is web-spa-integration-tests:
ThrowIfNotTestAssembly(Assembly.GetCallingAssembly());
Filed from timewarp-architecture task 058-001. That repo no longer renames the test assembly to web-spa-integration-Tests to satisfy the guard.
Summary
State<T>.ThrowIfNotTestAssemblyin TimeWarp.State 12.0.0-beta.3 and 12.0.0-beta.4 throwsFieldAccessExceptionunlessassembly.FullName.Contains("Test")(ordinal, case-sensitive).Kebab-case test assemblies such as
web-spa-integration-testscontaintestsbut notTest. A test that callsThrowIfNotTestAssembly(Assembly.GetCallingAssembly())fails even though it is a test assembly.State.Initialize()itself no longer calls this guard. The failure is on the protected helper that template debug seeders use.Expected
Treat the assembly name as a test assembly when it contains
testusingStringComparison.OrdinalIgnoreCase(or an equivalent check that accepts bothTestandtests).Actual
Repro
From a project whose assembly name is
web-spa-integration-tests:Filed from timewarp-architecture task 058-001. That repo no longer renames the test assembly to
web-spa-integration-Teststo satisfy the guard.