say I have a class:
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
and in a method I instantiate it:
public void SomeMethod(Person person)
{
person = new Person()
}
Before the person was passed in it had values set.
What is the best way to assert that SomeMethod
set the passed reference to a newly instantiated object?
All I can think of is to check all the nullable properties are empty and the non-nullable values have default values.
Is there a better way than this?