I have an object containing a char property. For my test, I need to have that property set to anything but I or R. Is there anything, ideally native to AutoFixture, that I could do to have cleaner, briefer code than what I came up with?
This is a representation of the object
public class MyObject
{
public char MyProperty {get; set;}
}
And the solution I'm using
MyObject = _fixture.Create<MyType>();
if ((new char[] { 'I', 'R' }).Contains(MyObject.MyProperty))
MyObject.MyProperty = new Generator<char>(_fixture).Where(c => !new char[] { 'I', 'R' }.Contains(c)).First();