Beispiel #1
0
        public void GetAllPartPositionNumbers_ShouldReturnEmptyListIfInputIsNull()
        {
            var actual1 = BOMAnalizeHelper.GetAllPartPositionNumbers(null, motorsExamples);
            var actual2 = BOMAnalizeHelper.GetAllPartPositionNumbers(partsExamples[0], null);

            Assert.Empty(actual1);
            Assert.Empty(actual2);
        }
Beispiel #2
0
        public void GetAllPartPositionNumbers_ShouldReturnEmptyListIfThereIsNoRelation()
        {
            var  motors = new List <Motor>(motorsExamples);
            Part part   = new Part("11111111");

            var actual = BOMAnalizeHelper.GetAllPartPositionNumbers(part, motors);

            Assert.Empty(actual);
        }
Beispiel #3
0
        public void GetAllPartPositionNumbers_ShouldReturnCorrectResult()
        {
            List <uint> expected = new List <uint>()
            {
                1, 2, 12
            };

            var  motors = new List <Motor>(motorsExamples);
            Part part   = new Part("11111111");

            motors[0].AddPart(part, expected[0], 1);
            motors[2].AddPart(part, expected[1], 2);
            motors[3].AddPart(part, expected[2], 2);

            var actual = BOMAnalizeHelper.GetAllPartPositionNumbers(part, motors);

            Assert.Equal(actual, expected);
        }
Beispiel #4
0
 public PartUsedWithModel(Part partUsedWith, IEnumerable <Motor> motorsUsedWith)
 {
     PartUsedWith    = partUsedWith;
     MotorsUsedWith  = new BindableCollection <Motor>(motorsUsedWith.OrderBy(o => o.FullDescription).ToList());
     PositionNumbers = String.Join(", ", BOMAnalizeHelper.GetAllPartPositionNumbers(partUsedWith, motorsUsedWith).OrderBy(p => p));
 }