public void DeleteEntityBadUrlReturnsStatusCode405() { //Setup var mService = new Mock <IClassService>(); mService.Setup(mock => mock.DeleteEntity(It.IsAny <int>())); //Action var controller = new ClassController(mService.Object); //Assert Assert.Equal("405", controller.DeleteEntityBadUrl().StatusCode.ToString()); }