The buzzword here (with plenty of literature out there) is Observable Effect. Usually it's either a state change, a return value or an exception that is thrown (or not).
If, for instance, you want to test that no exception is thrown (Observable Effect), then you need not assert on any output:
public void ShouldNotThrowException()
{
var objectUnderTest = new YourClass();
objectUnderTest.CheckModelDetail(null);
}
Try to remove your if (executeTemodel == null) clause and you will see that your test fails somewhere in checkModel (presuming you access members of your model in there). Any unhandled exception makes your test fail.
You could use Shouldly's Should.NotThrow to make this even more explicit:
public void ShouldNotThrowException()
{
var objectUnderTest = new YourClass();
Should.NotThrow(() => objectUnderTest.CheckModelDetail(null));
}
This not only tests your code, but also makes is very clear to whoever reads your test code what you expect.
Should you want to assert that checkModel() is not called, you should move this method into a different class and work with a Mock (see Martin Fowler's TestDouble for a nice overview). But I'm not sure whether you care about that as the consumer of CheckModelDetail. You should test what you want to happen (i.e. no exception thrown, model accepted as valid, model considered invalid, ...) as opposed to how it's achieved (i.e. checkModel is not called) in general, so you're free to refactor the implementation as long as the interface does not change.
executeTemodelis nullcheckModelis not called. It can be done using mock frameworks or by creating a dummy class deriving from your business class and overriding some of the methods or setting a flag.checkModeldo? I assume it checks wether the model is valid or something but then what? Does it thrown an exception or something? Is it a public method or private?