Exemplo n.º 1
0
        public void Jigsaw_Should_Throw_FitsWith_If_Null()
        {
            //arrange
            var board = new ObjectOrientedDesign.Jigsaw.Board(new List <Puzzle>());

            //act
            Action actFirst  = () => board.FitsWith(null, new Puzzle(PuzzleType.Corner, PuzzleDirection.Bottom), PuzzleDirection.Right);
            Action actSecond = () => board.FitsWith(new Puzzle(PuzzleType.Corner, PuzzleDirection.Bottom), null, PuzzleDirection.Right);

            //assert
            actFirst.ShouldThrow <ArgumentNullException>();
            actSecond.ShouldThrow <ArgumentNullException>();
        }
Exemplo n.º 2
0
        public void Jigsaw_Should_Check_FitsWith_Normal_With_Normal_Horizontal_Right()
        {
            //arrange
            var board = new ObjectOrientedDesign.Jigsaw.Board(new List <Puzzle>());

            var first  = new Puzzle(PuzzleType.Normal, PuzzleDirection.Top);
            var second = new Puzzle(PuzzleType.Normal, PuzzleDirection.Right);

            //act
            var result = board.FitsWith(first, second, PuzzleDirection.Right);

            //assert
            result.ShouldBeEquivalentTo(true);
        }
Exemplo n.º 3
0
        public void Jigsaw_Should_Check_FitsWith_Horizontal_Right_To_Vertical_Bottom_Case()
        {
            //arrange
            var board = new ObjectOrientedDesign.Jigsaw.Board(new List <Puzzle>());

            var first  = new Puzzle(PuzzleType.SideFlatHorizontal, PuzzleDirection.Top);
            var second = new Puzzle(PuzzleType.SideFlatVertical, PuzzleDirection.Top);

            //act
            var result = board.FitsWith(first, second, PuzzleDirection.Left);

            //assert
            result.ShouldBeEquivalentTo(true);
        }
Exemplo n.º 4
0
        public void Jigsaw_Should_Check_FitsWith_Top_Left_Corner_With_Vertical()
        {
            //arrange
            var board = new ObjectOrientedDesign.Jigsaw.Board(new List <Puzzle>());

            var first  = new Puzzle(PuzzleType.Corner, PuzzleDirection.Bottom);
            var second = new Puzzle(PuzzleType.SideFlatVertical, PuzzleDirection.Right);

            //act
            var result = board.FitsWith(first, second, PuzzleDirection.Bottom);

            //assert
            result.ShouldBeEquivalentTo(true);
        }