public void ReturnEmptySizeListWhenPositionIsNull()
        {
            var facade = new PositionListFacade(new PositionListStub(), new SizeListStub(), new IngredientListStub());
            var list   = facade.GetSizeList(null);

            Assert.AreEqual(0, list.Count);
        }
        public void GetSizeListWorks()
        {
            var facade   = new PositionListFacade(new PositionListStub(), new SizeListStub(), new IngredientListStub());
            var position = new Position(1, "1", "1");
            var list     = facade.GetSizeList(position);

            Assert.AreEqual(new Size(1, "size1", new Money(1), position), list[0]);
            Assert.AreEqual(new Size(2, "size2", new Money(1), position), list[1]);
        }
        public void MaximumSizeCountAccessorWorks()
        {
            var facade   = new PositionListFacade(new PositionListStub(), new SizeListStub(), new IngredientListStub());
            var position = new Position(1, "1", "1");

            facade.GetSizeList(position);
            var isMaximumCountOfSizes = facade.IsMaximumCountOfSizes(position);

            Assert.AreEqual(false, isMaximumCountOfSizes);
        }
Esempio n. 4
0
        public void FillDataGrid_fillsRowsCorrect()
        {
            var facade = new PositionListFacade(new PositionListStub(), new SizeListStub(),
                                                new IngredientListStub());
            var controller = new DataGridControllerStub(facade);

            controller.Position = facade.LoadPositionList()[0];
            var sizes = facade.GetSizeList(controller.Position);

            controller.Position.Sizes = sizes.ToImmutableList();
            controller.ClearIngredientListTest();
            controller.FillDataGridTest(sizes);
            Assert.AreEqual(1, controller.IngredientRows.Count);
            Assert.AreEqual("1", controller.IngredientRows.ToList()[0].Consumable);
            Assert.AreEqual(1.0, controller.IngredientRows.ToList()[0].Columns["size1"]);
        }