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 InsertMotors(IEnumerable <Motor> motorsToInsert)
        {
            if (motorsToInsert == null)
            {
                return;
            }
            var toInsert = BOMAnalizeHelper.GetOnlyUniqeMotors(_allMotors, motorsToInsert);

            _allMotors.AddRange(toInsert);
        }
Beispiel #4
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 #5
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));
 }
Beispiel #6
0
        public void UpdateMotors(IEnumerable <Motor> motorsToUpdate)
        {
            var result = BOMAnalizeHelper.GetMotorsToUpdate(_allMotors, motorsToUpdate);

            throw new NotImplementedException("UpdateMotors in RandomDataForTests");
        }