Пример #1
0
        public void StaffReportHop_ShouldReturnFalse_WhenNOTSucceeds()
        {
            string trackingId = "FALSCH";
            string code       = "BNDA04";

            DAL.Parcel p = null;
            DAL.Hop    h = null;
            _mock.Setup(x => x.GetByTrackingID(trackingId)).Returns(p);
            _mockHOP.Setup(x => x.GetByCode(code)).Returns(h);
            // Act
            var result = _controller.StaffReportHop(trackingId, code);

            // Assert
            Assert.IsFalse(result);
        }
Пример #2
0
        private List <Hop> GetRouteToRoot(Hop first)
        {
            List <Hop> route = new List <Hop>();
            var        child = _mapper.Map <DAL.Hop>(first);

            DAL.Hop parent = null;
            do
            {
                parent = _sqlRepoHop.GetParent(child);
                if (parent == null)
                {
                    break;
                }
                child = parent;
                route.Add(_mapper.Map <Hop>(parent));
            } while (parent != null && parent.Description != "DEBUG");

            return(route);
        }