public void GetAllImportadoresOk() { var logicMock = new Mock <DllImportador>(MockBehavior.Strict); var hospedajesMock = new Mock <IHospedaje>(MockBehavior.Strict); var puntosMock = new Mock <IPuntoTuristico>(MockBehavior.Strict); var configMock = new Mock <IConfiguration>(MockBehavior.Strict); ImportadoresController controller = new ImportadoresController(hospedajesMock.Object, puntosMock.Object, configMock.Object); string path = "C:\\Users\\diego\\Desktop\\Obligatorio_DA2\\ImportadorJSON\\bin\\Debug\\netcoreapp3.1\\Importador.dll"; configMock.Setup(x => x["Directory"]).Returns(path); var result = controller.GetAllImportadores(); var okResult = result as OkObjectResult; logicMock.VerifyAll(); }
public void GetCargarHospedajesImportadoresNombreVacio() { var importadorMock = new Mock <IArchivoImportador>(MockBehavior.Strict); var hospedajesMock = new Mock <IHospedaje>(MockBehavior.Strict); var puntosMock = new Mock <IPuntoTuristico>(MockBehavior.Strict); var configMock = new Mock <IConfiguration>(MockBehavior.Strict); ImportadoresController controller = new ImportadoresController(hospedajesMock.Object, puntosMock.Object, configMock.Object); string path = "C:\\Users\\diego\\Desktop\\Obligatorio_DA2\\ImportadorJSON\\bin\\Debug\\netcoreapp3.1\\Importador.dll"; configMock.Setup(x => x["Directory"]).Returns(path); var result = controller.GetCargarHospedajes("", It.IsAny <string>()); var okResult = result as BadRequestObjectResult; importadorMock.VerifyAll(); }