Skip to content

[Documentation]: mistake in test sample in Readme #78

@vlastroG

Description

@vlastroG

Provide a description of requested docs changes

Problem

It seems that these lines in Document testing are wrong:

    private Document _document = null!;
    private IList<Wall> _exteriorWalls = null!;

My test with similar code fails with this error:

System.InvalidOperationException: Attempted to write protected memory.
   at Nice3point.Revit.Injector.Injector.InjectApplication()
   at Nice3point.TUnit.Revit.RevitApplicationTest.InitializeRevitConnection()

Reproduced on Revit 2022 with TUnit.Revit 2022.1.1 and Revit 2024 with TUnit.Revit 2024.1.1. Removing null initializers eliminates this error. This idea came to me when I read 2027.0.1 release notes again:

TUnit 1.33 changed the order in which test classes are initialised

Proposed fix

I suggest these Readme changes:

    private Document _document;
    private IList<Wall> _exteriorWalls;

Type of documentation issue

Incorrect information

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation 📃Some proposed change related to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions