From 2a1c91c7239ea71a08e50d5f634addd636e31fe4 Mon Sep 17 00:00:00 2001 From: ADato88 Date: Mon, 24 Jan 2022 16:18:08 +0100 Subject: [PATCH] neue UnoTest.cs und Uno.cs mit Test ob Ablagestabel gleiche Farbe hat wie die Karte die man hinlegt --- .../MiniGames/Client/ViewModel/Uno.cs | 12 +++++++ BlazorSolution/MiniGamesTests/UnoTest.cs | 31 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 BlazorSolution/MiniGames/Client/ViewModel/Uno.cs create mode 100644 BlazorSolution/MiniGamesTests/UnoTest.cs diff --git a/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs b/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs new file mode 100644 index 0000000..8aab470 --- /dev/null +++ b/BlazorSolution/MiniGames/Client/ViewModel/Uno.cs @@ -0,0 +1,12 @@ +using System; + +namespace MiniGames.Client.ViewModel +{ + public class Uno + { + public bool IstAblageStabelFarbeGleichHand(string ablegeStapelKarte, string neueKarte) + { + return true; + } + } +} diff --git a/BlazorSolution/MiniGamesTests/UnoTest.cs b/BlazorSolution/MiniGamesTests/UnoTest.cs new file mode 100644 index 0000000..e210d49 --- /dev/null +++ b/BlazorSolution/MiniGamesTests/UnoTest.cs @@ -0,0 +1,31 @@ +using MiniGames.Client.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace MiniGamesTests +{ + public class UnoTest + { + public Uno UnoRegeln = new(); + + [Theory] + [InlineData("rot", "rot", true)] + private void IstAblageStabelFarbeGleichHandTest(string ablegeStapelKarte, string neueKarte, bool erwartet) + { + //arrange + var _ablegeStabelKarte = ablegeStapelKarte; + var _neueKarte = neueKarte; + var _erwartet = erwartet; + + //act + var erhalten = UnoRegeln.IstAblageStabelFarbeGleichHand(_ablegeStabelKarte, _neueKarte); + + //assert + Assert.Equal(_erwartet, erhalten); + } + } +}