I have a POCO class:
public class SomeEntity {
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
I want to test some other classes using different values in the SomeEntity class. The problem is that I need to check various combinations of many properties. For example:
- Id = 1, FirstName = null, LastName = "Doe"
- Id = 1, FirstName = "", LastName = "Doe"
- Id = 1, FirstName = "John", LastName = "Doe"
- Id = 1, FirstName = null, LastName = ""
- and etc.
Therefore, in each test, I want to create a test object as follows:
// test that someOtherObject always return the same result
// for testObject with ID = 1 and accepts any values from range of
// values for FirstName and LastName
var testObject = new SomeEntity {
Id = 1, // this must be always 1 for this test
FirstName = It.IsIn(someListOfPossibleValues), // each of this values must be accepted in test
LastName = It.IsIn(someListOfPossibleValues) // each of this values must be accepted in test
}
var result = someOtherObject.DoSomething(testObject);
Assert.AreEqual("some expectation", result);
I do not want to use nunit TestCase, as there will be many combinations (huge matrices).
, DoSomething .
: ?