public void Details_Controller_Test_On_Delete_Confirmed_With_Existent_Id() { //Arrange Guid id = new Guid("f616cc8c-2223-4145-b7d0-232a1f6f0795"); string feedBackMessage = "TestT"; int noOfPages = 10; int rating = 10; DateTime checkIn = DateTime.Now; DateTime checkOut = DateTime.Now.AddDays(1); Detail expectaDetail = new Detail(checkIn, checkOut, feedBackMessage, noOfPages, rating); expectaDetail.Id = id; var repo = Substitute.For <IRepository>(); var sut = new DetailsController(repo); repo.GetById <Detail>(id).Returns(expectaDetail); //Act var actual = sut.DeleteConfirmed(id).Result; //Assert Assert.IsInstanceOfType(actual, typeof(RedirectToActionResult)); }