Skip to content

[Doc] Basic Property Injection Examples TUnit0001 Error #3884

@Ted-Jin-Lab

Description

@Ted-Jin-Lab

The code in https://tunit.dev/docs/test-lifecycle/property-injection#basic-property-injection-examples got an error in the version 1.2.11.

I Got the error TUnit0001: Attribute argument types 'System.Collections.Generic.IEnumerable<string>' don't match method parameter types 'string' in the line [MethodDataSource(nameof(GetMethodData))]

However in the code about this feature, is like this in the github:

[MethodDataSource(nameof(MethodData))]
public required string Property2 { get; init; }

public static string MethodData() => "2";

Could you please update the document?

BTW, can we get the feature like the document?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions