Beispiel #1
0
            public void ResolveLastFrameResult_CheckRollsCountRange()
            {
                Action action = () => FrameResultResolver.ResolveLastFrameResult(new Roll[0], maxPinCount);

                action.Should().Throw <Exception>().WithMessage("FrameResult를 구할 수 없는 상태입니다.");

                action = () => FrameResultResolver.ResolveLastFrameResult(CreateRolls(1, 2, 3, 4), maxPinCount);
                action.Should().Throw <Exception>().WithMessage("FrameResult를 구할 수 없는 상태입니다.");
            }
Beispiel #2
0
            public void ResolveLastFrameResult_Spare()
            {
                var resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(1, maxPinCount - 1), maxPinCount);

                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.InProgress, FrameResultType.Spare });

                resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(1, maxPinCount - 1, maxPinCount), maxPinCount);
                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.InProgress, FrameResultType.Spare, FrameResultType.Strike });
            }
Beispiel #3
0
            public void ResolveLastFrameResult_Stirkes()
            {
                var resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(maxPinCount), maxPinCount);

                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.Strike });

                resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(maxPinCount, maxPinCount), maxPinCount);
                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.Strike, FrameResultType.Strike });

                resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(maxPinCount, maxPinCount, maxPinCount), maxPinCount);
                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.Strike, FrameResultType.Strike, FrameResultType.Strike });
            }
Beispiel #4
0
            public void ResolveLastFrameResult_Open()
            {
                var resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(1), maxPinCount);

                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.InProgress });

                resultType = FrameResultResolver.ResolveLastFrameResult(CreateRolls(1, 2), maxPinCount);
                resultType.Should().BeEquivalentTo(new FrameResultType[] { FrameResultType.InProgress, FrameResultType.Open });

                Action action = () => FrameResultResolver.ResolveLastFrameResult(CreateRolls(1, 2, 3), maxPinCount);

                action.Should().Throw <Exception>().WithMessage("FrameResult를 구할 수 없는 상태입니다.");
            }