public void GetMethod_NonExistentAuction_ExpectNull() { Mock <IAuctionDao> mockDao = new Mock <IAuctionDao>(); mockDao.Setup(dao => dao.Get(It.IsAny <int>())); AuctionsController controller = new AuctionsController(mockDao.Object); //Auction actual = controller.Get(23); object actual = SafeReflection.InvokeMethod(controller, "Get", new object[] { 23 }); //if this assertion fails, method or parameter has not yet been added. Need this test because `actual` will be null if method or parameter doesn't exist, and give a false positive Assert.IsTrue(SafeReflection.HasMethodWithParameterTypes(controller.GetType(), "Get", new Type[] { typeof(int) })); Assert.IsNull(actual); }