If controller.Create()
is always creating ViewResult you must use explicit cast
var viewResult = (ViewResult)controller.Create();
else you must write another test for controller.Create()
.
The assertion code var viewModel = viewResult.Model as DraftViewModel;
are using as
, if the conversion isn't possible, as returns null so instead of IsInstanceOfType
use IsNUllIsNotNUll
.
By the way, I can't get the act of your test by seeing your method name and I recommend you to read this article.