public void GetAllPartPositionNumbers_ShouldReturnEmptyListIfInputIsNull() { var actual1 = BOMAnalizeHelper.GetAllPartPositionNumbers(null, motorsExamples); var actual2 = BOMAnalizeHelper.GetAllPartPositionNumbers(partsExamples[0], null); Assert.Empty(actual1); Assert.Empty(actual2); }
public void GetAllPartPositionNumbers_ShouldReturnEmptyListIfThereIsNoRelation() { var motors = new List <Motor>(motorsExamples); Part part = new Part("11111111"); var actual = BOMAnalizeHelper.GetAllPartPositionNumbers(part, motors); Assert.Empty(actual); }
public void InsertMotors(IEnumerable <Motor> motorsToInsert) { if (motorsToInsert == null) { return; } var toInsert = BOMAnalizeHelper.GetOnlyUniqeMotors(_allMotors, motorsToInsert); _allMotors.AddRange(toInsert); }
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); }
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)); }
public void UpdateMotors(IEnumerable <Motor> motorsToUpdate) { var result = BOMAnalizeHelper.GetMotorsToUpdate(_allMotors, motorsToUpdate); throw new NotImplementedException("UpdateMotors in RandomDataForTests"); }