diff --git a/DoubleDeckerBus/DoubleDeckerBus/SetBusesGeneric.cs b/DoubleDeckerBus/DoubleDeckerBus/SetBusesGeneric.cs index 3897636..656e894 100644 --- a/DoubleDeckerBus/DoubleDeckerBus/SetBusesGeneric.cs +++ b/DoubleDeckerBus/DoubleDeckerBus/SetBusesGeneric.cs @@ -29,7 +29,10 @@ namespace DoubleDeckerBus public int Insert(T bus, int position) { - // TODO Проверка на уникальность + if (_places.Contains(bus)) + { + throw new ArgumentException("The same bus exist"); + } if (position < 0 || position >= _maxCount) {