コード例 #1
0
        /// <summary>
        /// Add a softdrink to the catalog
        /// </summary>
        /// <param name="drink">An object of a SoftDrink</param>
        public void Add(SoftDrink drink)
        {
	       var temp = Get(drink.Label);

			if (_softDrinks.Contains(temp))
				_softDrinks.Remove(temp);
			_softDrinks.Add(drink);
        }
コード例 #2
0
		public void AddSodaToCatalog()
		{
			var myCult = new SoftDrink("Cult", 9.95);
			catalog.Add(myCult);
			Assert.AreSame(myCult, catalog.Get("Cult"));
		}