public void ConvertirFecha_FechaCorrecta_Fecha(string fecha) { //Arrange ValidadorFecha convertidorFecha = new ValidadorFecha(); //Act DateTime fechaEvento = convertidorFecha.ValidarFechaString(fecha); //Assert Assert.IsNotNull(fechaEvento); }
public void ConvertirFecha_FechaInCorrecta_Excepcion(string fecha) { //Arrange ValidadorFecha convertidorFecha = new ValidadorFecha(); //Act ArgumentException error = Assert.ThrowsException <ArgumentException>(() => convertidorFecha.ValidarFechaString(fecha)); //Assert Assert.AreEqual("La fecha tiene un formato incorrecto", error.Message); }