From f71d96b739c1fe1dcfa3f47730df6a5206b431e0 Mon Sep 17 00:00:00 2001 From: Felix Detig Date: Mon, 14 Feb 2022 03:07:15 +0100 Subject: [PATCH] =?UTF-8?q?TicTacToeBrett.Gewinner-Test=20f=C3=BCr=20nicht?= =?UTF-8?q?=20volle=20Reihen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MiniGamesTests/TicTacToeBrettTest.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/BlazorSolution/MiniGamesTests/TicTacToeBrettTest.cs b/BlazorSolution/MiniGamesTests/TicTacToeBrettTest.cs index 30e24c1..36ea54a 100644 --- a/BlazorSolution/MiniGamesTests/TicTacToeBrettTest.cs +++ b/BlazorSolution/MiniGamesTests/TicTacToeBrettTest.cs @@ -263,5 +263,43 @@ namespace MiniGamesTests // assert Assert.Equal(erwarteterGewinner, erhaltenerGewinner); } + + [Theory] + [InlineData( + 0, TicTacToeBrett.LEER, 0, + TicTacToeBrett.LEER, TicTacToeBrett.LEER, TicTacToeBrett.LEER, + 0, TicTacToeBrett.LEER, 0 + )] + [InlineData( + 1, 1, TicTacToeBrett.LEER, + 1, 1, TicTacToeBrett.LEER, + TicTacToeBrett.LEER, TicTacToeBrett.LEER, TicTacToeBrett.LEER + )] + [InlineData( + 2, TicTacToeBrett.LEER, TicTacToeBrett.LEER, + 2, TicTacToeBrett.LEER, 2, + TicTacToeBrett.LEER, 2, 2 + )] + [InlineData( + 1, 1, 2, + 1, 3, 2, + 2, 3, 3 + )] + public void Gewinner_NichtVolleReihenTest( + int a = TicTacToeBrett.LEER, int b = TicTacToeBrett.LEER, int c = TicTacToeBrett.LEER, + int d = TicTacToeBrett.LEER, int e = TicTacToeBrett.LEER, int f = TicTacToeBrett.LEER, + int g = TicTacToeBrett.LEER, int h = TicTacToeBrett.LEER, int i = TicTacToeBrett.LEER + ) + { + // arrange + TicTacToeBrett brett = TestBrett(a, b, c, d, e, f, g, h, i); + int erwarteterGewinner = TicTacToeBrett.LEER; + + // act + int erhaltenerGewinner = brett.Gewinner(); + + // assert + Assert.Equal(erwarteterGewinner, erhaltenerGewinner); + } } }