Browse Source

test: add unit class

Otter 4 months ago
parent
commit
e1dccad3af
3 changed files with 52 additions and 1 deletions
  1. 7 1
      HelloItQuantum.sln
  2. 27 0
      LibraryUnitTests/LibraryUnitTests.csproj
  3. 18 0
      LibraryUnitTests/UnitTest1.cs

+ 7 - 1
HelloItQuantum.sln

@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 17
 VisualStudioVersion = 17.10.34916.146
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloItQuantum", "HelloItQuantum\HelloItQuantum.csproj", "{BFFAC117-DF28-482E-9E31-57116A7FBE03}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloItQuantum", "HelloItQuantum\HelloItQuantum.csproj", "{BFFAC117-DF28-482E-9E31-57116A7FBE03}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryUnitTests", "LibraryUnitTests\LibraryUnitTests.csproj", "{984BC1C7-CEA0-4E4D-A483-16214DC87B97}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +17,10 @@ Global
 		{BFFAC117-DF28-482E-9E31-57116A7FBE03}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{BFFAC117-DF28-482E-9E31-57116A7FBE03}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{BFFAC117-DF28-482E-9E31-57116A7FBE03}.Release|Any CPU.Build.0 = Release|Any CPU
+		{984BC1C7-CEA0-4E4D-A483-16214DC87B97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{984BC1C7-CEA0-4E4D-A483-16214DC87B97}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{984BC1C7-CEA0-4E4D-A483-16214DC87B97}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{984BC1C7-CEA0-4E4D-A483-16214DC87B97}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 27 - 0
LibraryUnitTests/LibraryUnitTests.csproj

@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+
+    <IsPackable>false</IsPackable>
+    <IsTestProject>true</IsTestProject>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="coverlet.collector" Version="6.0.0" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
+    <PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
+    <PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\HelloItQuantum\HelloItQuantum.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
+  </ItemGroup>
+
+</Project>

+ 18 - 0
LibraryUnitTests/UnitTest1.cs

@@ -0,0 +1,18 @@
+using Avalonia.Controls;
+using HelloItQuantum.Function;
+
+namespace LibraryUnitTests
+{
+	[TestClass]
+	public class UnitTests
+	{
+		[TestMethod]
+		public void NameBlablabla()
+		{
+			//ïàòòåðí ÀÀÀ äîëæåí áûòü íî åãî íåò
+			string str = "õàíà";
+			ComboBoxItem d = Converts.GenericToItem(str);
+			Assert.IsNotNull(d);
+		}
+	}
+}