public void Teachers_Controller_Test_On_Delete_Confirmed_With_Existent_Id() { //Arrange Guid id = new Guid("f616cc8c-2223-4145-b7d0-232a1f6f0795"); string firstName = "TestF"; string lastName = "TestL"; string userName = "******"; string password = "******"; string emailAdress = "TestE"; Teacher expectedTeacher = new Teacher(firstName, lastName, userName, password, emailAdress); expectedTeacher.Id = id; var repo = Substitute.For <IRepository>(); var sut = new TeachersController(repo); repo.GetById <Teacher>(id).Returns(expectedTeacher); //Act var actual = sut.DeleteConfirmed(id).Result; //Assert Assert.IsInstanceOfType(actual, typeof(RedirectToActionResult)); }