Exemple #1
0
        public void Rejectzeroamount()
        {
            var moq = new Mock <ISimpleRepo <OtherColxnDTO> >();
            var sut = new OtherColxnsRepo1(moq.Object);
            var obj = ValidSampleDTO();

            obj.Amount = 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.Amount = 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.Amount = -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();
        }
Exemple #2
0
        public void RejectsnullBankAccount()
        {
            var moq = new Mock <ISimpleRepo <OtherColxnDTO> >();
            var sut = new OtherColxnsRepo1(moq.Object);
            var obj = ValidSampleDTO();

            obj.Collector = 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.Collector = new CollectorDTO();
            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();
        }
Exemple #3
0
        public void Rejectsblankdepositslip()
        {
            var moq = new Mock <ISimpleRepo <OtherColxnDTO> >();
            var sut = new OtherColxnsRepo1(moq.Object);
            var obj = ValidSampleDTO();

            obj.DocumentRef = "";
            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.DocumentRef = "efg";
            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();
        }