예제 #1
0
        public decimal GetStok(string brgID)
        {
            decimal result   = 0;
            var     listStok = _stokInDal.ListData(brgID);

            if (listStok != null)
            {
                result = listStok.Sum(x => x.QtySaldo);
            }
            return(result);
        }
예제 #2
0
        public void ListDataTest()
        {
            using (var trans = TransHelper.NewScope())
            {
                //  arrange
                var item1 = StokInDataFactory();
                _stokInDal.Insert(item1);
                var item2 = StokInDataFactory2();
                _stokInDal.Insert(item2);
                var expected = new List <StokInModel>
                {
                    item1, item2
                };

                //  act
                var actual = _stokInDal.ListData("B1");

                //  assert
                actual.Should().BeEquivalentTo(expected,
                                               config => config
                                               .Excluding(x => x.BrgName));
            }
        }