public void LoadPositionList_fillsConsumables()
        {
            var positionList = new PositionListDataHolderStub(new PositionRepositoryStub());

            positionList.LoadPositionList();
            Assert.AreEqual(1, positionList.Consumables.Count);
        }
        public void ConsumablesWork()
        {
            var           stub         = new PositionListDataHolderStub();
            IPositionList positionList = new PositionListFeedback(stub);
            var           consumables  = positionList.Consumables;

            Assert.AreEqual(new Consumable(1, "water", 0), consumables[0]);
        }
        public void UpdatePositionInvokesDataHolderUpdatePositionMethod()
        {
            var           stub         = new PositionListDataHolderStub();
            IPositionList positionList = new PositionListFeedback(stub);
            bool          invoked      = false;
            EventHandler <PositionListChangedEventArgs> handler = (sender, e) => invoked = true;

            stub.PositionListChanged += handler;
            positionList.UpdatePosition(new DTO.Position(1, "1", "1"));
            Assert.IsTrue(invoked);
        }
        public void AddPosition_Method_Invokes_PositionAdded_Event()
        {
            var           stub         = new PositionListDataHolderStub();
            IPositionList positionList = new PositionListFeedback(stub);
            bool          invoked      = false;
            EventHandler <PositionListChangedEventArgs> handler = (sender, e) => invoked = true;

            positionList.PositionListChanged += handler;
            positionList.AddPosition(new DTO.Position(1, "1", "1"));
            Assert.IsTrue(invoked);
        }
        public void DeleteSizeInvokesDataHolderDeleteSizeMethod()
        {
            var       stub     = new PositionListDataHolderStub();
            ISizeList sizeList = new SizeListFeedback(stub);
            bool      invoked  = false;
            EventHandler <SizeListChangedEventArgs> handler = (sender, e) => invoked = true;

            stub.SizeListChanged += handler;
            sizeList.DeleteSize(new DTOSize(1, "1", new Money(1), new DTO.Position(1, "1", "1")));
            Assert.IsTrue(invoked);
        }
        public void DeleteIngredientInvokesDataHolderDeleteIngredientMethod()
        {
            var             stub           = new PositionListDataHolderStub();
            IIngredientList ingredientList = new IngredientListFeedback(stub);
            bool            invoked        = false;
            EventHandler <IngredientListChangedEventArgs> handler = (sender, e) => invoked = true;

            stub.IngredientListChanged += handler;
            var dtoPosition = new DTO.Position(1, "1", "1");

            ingredientList.DeleteIngredient(new DTOIngredient(1, 1, new DTO.Size(1, "1", new Money(1), dtoPosition), new DTO.Consumable(1, "water", 1)));
            Assert.IsTrue(invoked);
        }