Ejemplo n.º 1
0
        public IEnumerable<BPPiutangSearchModel> Search()
        {
            var listData = _bpPiutangDal.ListData();
            if (listData == null) return null;

            var result = listData.Select(x => (BPPiutangSearchModel)x);

            if (SearchFilter.UserKeyword != null)
                return
                    from c in result
                    where c.PihakKeduaName.ContainMultiWord(SearchFilter.UserKeyword)
                    select c;

            return result;
        }
Ejemplo n.º 2
0
        public void ListDataTest()
        {
            using (var trans = TransHelper.NewScope())
            {
                //  arrange
                var expected1 = BPPiutangDataFactory();
                _bpPiutangDal.Insert(expected1);
                var expected2 = expected1.CloneObject();
                expected2.BPPiutangID = "A2";
                _bpPiutangDal.Insert(expected2);

                var expected = new List <BPPiutangModel>
                {
                    expected1, expected2
                };

                //  act
                var actual = _bpPiutangDal.ListData(expected1.Tgl, expected1.Tgl);

                //  assert
                actual.Should().BeEquivalentTo(expected);
            }
        }