public void Rejectsblankdepositslip() { var moq = new Mock <ISimpleRepo <IntendedColxnDTO> >(); var sut = new IntendedColxnsRepo1(moq.Object); var obj = ValidSampleDTO(); obj.PRNumber = 0; sut.IsValidForInsert(obj, out string why).Should().BeFalse(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeFalse(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); obj.PRNumber = 123; obj.Id = 0; sut.IsValidForInsert(obj, out why).Should().BeTrue(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeTrue(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); obj.PRNumber = -456; obj.Id = 0; sut.IsValidForInsert(obj, out why).Should().BeFalse(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeFalse(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); }
public void Rejectzeroamount() { var moq = new Mock <ISimpleRepo <IntendedColxnDTO> >(); var sut = new IntendedColxnsRepo1(moq.Object); var obj = ValidSampleDTO(); obj.Actuals.Rent = 0; sut.IsValidForInsert(obj, out string why).Should().BeFalse(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeFalse(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); obj.Actuals.Rent = 123; obj.Id = 0; sut.IsValidForInsert(obj, out why).Should().BeTrue(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeTrue(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); obj.Actuals.Rent = -456; obj.Id = 0; sut.IsValidForInsert(obj, out why).Should().BeFalse(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeFalse(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); }
public void RejectsnullStall() { var moq = new Mock <ISimpleRepo <IntendedColxnDTO> >(); var sut = new IntendedColxnsRepo1(moq.Object); var obj = ValidSampleDTO(); obj.Lease.Stall = null; sut.IsValidForInsert(obj, out string why).Should().BeFalse(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeFalse(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); obj.Lease.Stall = ValidSampleStall(); obj.Id = 0; sut.IsValidForInsert(obj, out why).Should().BeTrue(); obj.Id = 123; sut.IsValidForUpdate(obj, out why).Should().BeTrue(); sut.IsValidForDelete(obj, out why).Should().BeTrue(); }