From ebd30677424b859ae1c572a1d50527494ad5ae45 Mon Sep 17 00:00:00 2001 From: ADato88 Date: Mon, 24 Jan 2022 16:30:05 +0100 Subject: [PATCH] IstAblageStabelFarbeGleichHand checkt ob aktuelle Karte gleich neue Karte --- BlazorSolution/MiniGames/Client/ViewModel/Uno.cs | 11 +++++++++-- BlazorSolution/MiniGamesTests/UnoTest.cs | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs b/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs index 8aab470..697d850 100644 --- a/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs +++ b/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs @@ -1,4 +1,5 @@ -using System; +using MiniGames.Shared.Models; +using System; namespace MiniGames.Client.ViewModel { @@ -6,7 +7,13 @@ namespace MiniGames.Client.ViewModel { public bool IstAblageStabelFarbeGleichHand(string ablegeStapelKarte, string neueKarte) { - return true; + if (ablegeStapelKarte.Equals(neueKarte)) + { + return true; + } else + { + return false; + } } } } diff --git a/BlazorSolution/MiniGamesTests/UnoTest.cs b/BlazorSolution/MiniGamesTests/UnoTest.cs index e210d49..8f7ef96 100644 --- a/BlazorSolution/MiniGamesTests/UnoTest.cs +++ b/BlazorSolution/MiniGamesTests/UnoTest.cs @@ -14,6 +14,11 @@ namespace MiniGamesTests [Theory] [InlineData("rot", "rot", true)] + [InlineData("blau", "rot", false)] + [InlineData("rot", "blau", false)] + [InlineData("blau", "blau", true)] + [InlineData("gelb", "rot", false)] + [InlineData("gruen", "gruen", true)] private void IstAblageStabelFarbeGleichHandTest(string ablegeStapelKarte, string neueKarte, bool erwartet) { //arrange