Skip to content

Serialization requirement in the test arguments #19

@friendly-source-bot

Description

@friendly-source-bot

Issue created by @rubenhak as Bitbucket Issue #​19 on 2016.10.15 13:59.
The NUnit.ApplicationDomain requires test arguments to be Serializable. It indeed might be a valid requirement, but when an argument is not serializable the test infra hangs in "Cancelling" state waiting for the text execution to be terminated.

The test returned following error:
System.Runtime.Serialization.SerializationException : Type 'MyType' in assembly 'MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

private static MyType[] MyTestData = new[]{
            new MyTestData(1),
            new MyTestData(2),
            new MyTestData(3),
            new MyTestData(4)
            };


[Test]
[RunInApplicationDomain]
public void MyTest([ValueSource("MyTestData")]MyType testData)
{

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions