Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to "Freeze" parameter specifying value? #34

Open
raffii90 opened this issue Sep 9, 2020 · 2 comments
Open

Is it possible to "Freeze" parameter specifying value? #34

raffii90 opened this issue Sep 9, 2020 · 2 comments
Labels
question Further information is requested

Comments

@raffii90
Copy link

raffii90 commented Sep 9, 2020

It is not an issue, but a question. I wonder is it possible to extend frozen attribute and set the value? To have something like this.

    public class TestClass
    {
        public string TestProperty { get; set; }
    }

    [Test]
    public void Test_method([Frozen("someString")] string parameter, TestClass sut)
    {
        Assert.That(sut.TestProperty, Is.EqualTo("someString"));
    }
@Kralizek Kralizek added the question Further information is requested label Sep 9, 2020
@Kralizek
Copy link
Contributor

Kralizek commented Sep 9, 2020

The Frozen attribute does not support this use case. In reality what you would like to use is something that can Inject a certain value.

I suggest you asking this question directly at the AutoFixture repo.

If you want, you can even start working on a PR for it. What you'd need is:

If you end up creating an issue in AutoFixture, please link this one :)

@Kralizek
Copy link
Contributor

I created this PR to solve the issue AutoFixture/AutoFixture#1199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants