Unit testing – casting an OkResult. What happens if the object cannot be cast to OkResult? – Asp.net
I've just started Unit Testing and I'm having some trouble understanding how should I write them. I have this code [Theory] [InlineData("00000000-0000-0000-0000-000000000001")] [InlineData("00000000-0000-0000-0000-000000000002")] public void Delete_Intern(Guid id) { _internService.Setup(x => x.Delete(It.IsAny<Guid>())).Returns(true); var actual = (OkResult) _internsController.DeleteIntern(id); Assert.True(actual is OkResult); }…