Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }