From 85f5d7f093aec85a69bb691d8bc44af72c7e3528 Mon Sep 17 00:00:00 2001 From: shadowik Date: Mon, 12 Dec 2022 20:33:30 +0400 Subject: [PATCH] Final --- DoubleDeckerBus/DoubleDeckerBus/SetBusesGeneric.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {