Exemplo n.º 1
0
        public void OrderAddsAndUpdatesBoard()
        {
            IBoardRepository brf = new BoardRepositoryFile(@"C:\VareNr");

            Board newBoard = new Board(2000, 150, 500, Surfaces.H1, true, brf);

            newBoard.Quantity = 2;
            Board anotherBoard = new Board(2000, 300, 400, Surfaces.H1, true, brf);

            anotherBoard.Quantity = 2;
            Board thirdBoard = new Board(2000, brf);

            thirdBoard.Quantity = 2;

            order.AddBoard(newBoard, brf);
            order.AddBoard(anotherBoard, brf);
            order.AddBoard(thirdBoard, brf);

            Board actualBoard   = order.GetBoard();
            Board boardFromRepo = new Board(2000, brf);

            Assert.AreEqual(300, actualBoard.Length);
            Assert.AreEqual(400, actualBoard.Width);
            Assert.AreEqual(6, actualBoard.Quantity);

            Assert.AreEqual(300, boardFromRepo.Length);
            Assert.AreEqual(400, boardFromRepo.Width);
        }
Exemplo n.º 2
0
        public void SaveBoardToFile()
        {
            IBoardRepository br    = new BoardRepositoryFile(@"C:\VareNumre");
            Board            board = new Board(1000, 100, 100, Surfaces.H1, true, br);

            Board actualBoard = br.LoadBoard(1000);

            Assert.AreEqual(100, actualBoard.Width);
            Assert.AreEqual(Surfaces.H1, actualBoard.Surface);
        }