public void CalculaDia_MismoDia_MensajeCorrecto() { var DOCCalculaDia = new Mock <IValidarDia>(); DOCCalculaDia.Setup(DOC => DOC.ValidaDia(new DateTime(2019, 12, 2), new DateTime(2019, 12, 01))).Returns(true); var SUT = new CalcularDia(DOCCalculaDia.Object); var result = SUT.CalculaDia(new DateTime(2019, 12, 2), new DateTime(2018, 12, 01)); Assert.AreEqual("ocurrió hace 1 día.", result); }
public void ValidaDia_DiferenteDia_Verdadero() { var DOCValidarDia = new Mock <IValidarDia>(); DOCValidarDia.Setup(DOC => DOC.ValidaDia(new DateTime(2018, 12, 2), new DateTime(2019, 12, 01))).Returns(true); var SUT = new ValidarDia(); var result = SUT.ValidaDia(new DateTime(2018, 10, 2), new DateTime(2019, 12, 01)); Assert.IsFalse(result); }