From da94ed6d89ac2b933718419bbe42f2d913514231 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 14 Dec 2022 09:53:10 +0300 Subject: Init commit --- RhSolutions.Api.Tests/RhSolutions.Api.Tests.csproj | 28 ++++++++++++++++++++++ RhSolutions.Api.Tests/SkuExtensionsTest.cs | 25 +++++++++++++++++++ RhSolutions.Api.Tests/Usings.cs | 1 + 3 files changed, 54 insertions(+) create mode 100644 RhSolutions.Api.Tests/RhSolutions.Api.Tests.csproj create mode 100644 RhSolutions.Api.Tests/SkuExtensionsTest.cs create mode 100644 RhSolutions.Api.Tests/Usings.cs (limited to 'RhSolutions.Api.Tests') diff --git a/RhSolutions.Api.Tests/RhSolutions.Api.Tests.csproj b/RhSolutions.Api.Tests/RhSolutions.Api.Tests.csproj new file mode 100644 index 0000000..263aa54 --- /dev/null +++ b/RhSolutions.Api.Tests/RhSolutions.Api.Tests.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + enable + + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/RhSolutions.Api.Tests/SkuExtensionsTest.cs b/RhSolutions.Api.Tests/SkuExtensionsTest.cs new file mode 100644 index 0000000..f260af7 --- /dev/null +++ b/RhSolutions.Api.Tests/SkuExtensionsTest.cs @@ -0,0 +1,25 @@ +using RhSolutions.Api.Models; + +namespace RhSolutions.Tests +{ + public class SkuExtensionsTests + { + [Theory] + [InlineData("11600011001")] + [InlineData(" 11600011001")] + [InlineData("11600011001 ")] + [InlineData("string 11600011001")] + [InlineData("11600011001 string")] + [InlineData("160001-001")] + [InlineData("string 160001-001")] + [InlineData("160001-001 string")] + [InlineData("160001001")] + [InlineData("string 160001001")] + [InlineData("160001001 string")] + public void TestName(string input) + { + Sku.TryParse(input, out IEnumerable sku); + Assert.Equal(new Sku("160001", "001"), sku.FirstOrDefault()); + } + } +} \ No newline at end of file diff --git a/RhSolutions.Api.Tests/Usings.cs b/RhSolutions.Api.Tests/Usings.cs new file mode 100644 index 0000000..8c927eb --- /dev/null +++ b/RhSolutions.Api.Tests/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file -- cgit v1.2.3