add test for fill

This commit is contained in:
git 2024-10-08 13:58:42 +03:00
parent 12d34f5c88
commit 1bd4c3038a
15 changed files with 36 additions and 40 deletions

Binary file not shown.

View File

@ -2,10 +2,6 @@
"Version": 1, "Version": 1,
"WorkspaceRootPath": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\", "WorkspaceRootPath": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\",
"Documents": [ "Documents": [
{
"AbsoluteMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|c:\\users\\hackaton\\source\\repos\\matrixsolution\\matrixsol\\matrixproject.test\\matrixproject.test.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|",
"RelativeMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|solutionrelative:matrixproject.test\\matrixproject.test.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|"
},
{ {
"AbsoluteMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|c:\\users\\hackaton\\source\\repos\\matrixsolution\\matrixsol\\matrixproject.test\\matrixtest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "AbsoluteMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|c:\\users\\hackaton\\source\\repos\\matrixsolution\\matrixsol\\matrixproject.test\\matrixtest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|solutionrelative:matrixproject.test\\matrixtest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" "RelativeMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|solutionrelative:matrixproject.test\\matrixtest.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
@ -13,6 +9,10 @@
{ {
"AbsoluteMoniker": "D:0:0:{E812BC68-6D94-4469-B05B-ADCA58D74C56}|MatrixProject\\MatrixProject.csproj|c:\\users\\hackaton\\source\\repos\\matrixsolution\\matrixsol\\matrixproject\\matrix.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "AbsoluteMoniker": "D:0:0:{E812BC68-6D94-4469-B05B-ADCA58D74C56}|MatrixProject\\MatrixProject.csproj|c:\\users\\hackaton\\source\\repos\\matrixsolution\\matrixsol\\matrixproject\\matrix.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{E812BC68-6D94-4469-B05B-ADCA58D74C56}|MatrixProject\\MatrixProject.csproj|solutionrelative:matrixproject\\matrix.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" "RelativeMoniker": "D:0:0:{E812BC68-6D94-4469-B05B-ADCA58D74C56}|MatrixProject\\MatrixProject.csproj|solutionrelative:matrixproject\\matrix.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|c:\\users\\hackaton\\source\\repos\\matrixsolution\\matrixsol\\matrixproject.test\\matrixproject.test.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|",
"RelativeMoniker": "D:0:0:{67C8B376-25F3-481A-8684-66E651A0461B}|MatrixProject.Test\\MatrixProject.Test.csproj|solutionrelative:matrixproject.test\\matrixproject.test.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|"
} }
], ],
"DocumentGroupContainers": [ "DocumentGroupContainers": [
@ -22,46 +22,44 @@
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 200,
"SelectedChildIndex": 0, "SelectedChildIndex": 1,
"Children": [ "Children": [
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 0, "DocumentIndex": 2,
"Title": "MatrixProject.Test", "Title": "MatrixProject.Test.csproj",
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj", "DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixProject.Test.csproj", "RelativeDocumentMoniker": "MatrixProject.Test\\MatrixProject.Test.csproj",
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj", "ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
"RelativeToolTip": "MatrixProject.Test\\MatrixProject.Test.csproj", "RelativeToolTip": "MatrixProject.Test\\MatrixProject.Test.csproj",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2024-10-08T07:03:47.001Z", "WhenOpened": "2024-10-08T07:03:47.001Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 1, "DocumentIndex": 0,
"Title": "MatrixTest.cs", "Title": "MatrixTest.cs",
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs", "DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs",
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixTest.cs", "RelativeDocumentMoniker": "MatrixProject.Test\\MatrixTest.cs",
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs*", "ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs*",
"RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs*", "RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs*",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA4AAAAZAAAAAAAAAA==", "ViewState": "AgIAABkAAAAAAAAAAAAAACAAAAAvAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-08T06:41:24.991Z", "WhenOpened": "2024-10-08T06:41:24.991Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 2, "DocumentIndex": 1,
"Title": "Matrix.cs", "Title": "Matrix.cs",
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs", "DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs",
"RelativeDocumentMoniker": "MatrixProject\\Matrix.cs", "RelativeDocumentMoniker": "MatrixProject\\Matrix.cs",
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs*", "ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs",
"RelativeToolTip": "MatrixProject\\Matrix.cs*", "RelativeToolTip": "MatrixProject\\Matrix.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABgAAAAIAAAAAAAAAA==", "ViewState": "AgIAABYAAAAAAAAAAAAqwAsAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-08T06:36:26.85Z", "WhenOpened": "2024-10-08T06:36:26.85Z"
"EditorCaption": ""
} }
] ]
} }

View File

@ -27,15 +27,14 @@
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 2, "DocumentIndex": 2,
"Title": "MatrixProject.Test", "Title": "MatrixProject.Test.csproj",
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj", "DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixProject.Test.csproj", "RelativeDocumentMoniker": "MatrixProject.Test\\MatrixProject.Test.csproj",
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj", "ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
"RelativeToolTip": "MatrixProject.Test\\MatrixProject.Test.csproj", "RelativeToolTip": "MatrixProject.Test\\MatrixProject.Test.csproj",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2024-10-08T07:03:47.001Z", "WhenOpened": "2024-10-08T07:03:47.001Z"
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
@ -43,9 +42,9 @@
"Title": "MatrixTest.cs", "Title": "MatrixTest.cs",
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs", "DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs",
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixTest.cs", "RelativeDocumentMoniker": "MatrixProject.Test\\MatrixTest.cs",
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs", "ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs*",
"RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs", "RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs*",
"ViewState": "AgIAABcAAAAAAAAAAAAAABsAAAA0AAAAAAAAAA==", "ViewState": "AgIAABYAAAAAAAAAAAAAACAAAAA6AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-08T06:41:24.991Z", "WhenOpened": "2024-10-08T06:41:24.991Z",
"EditorCaption": "" "EditorCaption": ""
@ -60,8 +59,7 @@
"RelativeToolTip": "MatrixProject\\Matrix.cs", "RelativeToolTip": "MatrixProject\\Matrix.cs",
"ViewState": "AgIAABYAAAAAAAAAAAAqwAsAAAAAAAAAAAAAAA==", "ViewState": "AgIAABYAAAAAAAAAAAAqwAsAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-10-08T06:36:26.85Z", "WhenOpened": "2024-10-08T06:36:26.85Z"
"EditorCaption": ""
} }
] ]
} }

View File

@ -1,3 +1,5 @@
using System.Reflection;
namespace MatrixProject.Test; namespace MatrixProject.Test;
public class MatrixTest public class MatrixTest
@ -24,23 +26,21 @@ public class MatrixTest
Assert.Equal(5, matrix.Columns); Assert.Equal(5, matrix.Columns);
} }
[Fact] [Theory]
public void CheckFillMatrixInDefaultConstructor() { [MemberData(nameof(testTwoDimArray))]
public void CheckFillMatrixInDefaultConstructor(int row, int column, int fillNumber, double[,] testArray) {
Matrix matrix = new Matrix(); Matrix matrix = new Matrix(row, column, fillNumber);
double[,] testMatrix = new double[,] { Assert.True(EqualsTwoDimArray(testArray, matrix));
{ 1, 1, 1, 1, 1},
{ 1, 1, 1, 1, 1},
{ 1, 1, 1, 1, 1},
{ 1, 1, 1, 1, 1},
{ 1, 1, 1, 1, 1}
};
Assert.True(EqualsTwoDimArray(testMatrix, matrix));
} }
public static TheoryData<int, int,int, double[,]> testTwoDimArray => new () {
{2, 2, 3, new double[,] { { 3, 3 }, { 3, 3 } } }
};
private bool EqualsTwoDimArray(double[,] testMatrix, Matrix matrix) { private bool EqualsTwoDimArray(double[,] testMatrix, Matrix matrix) {
if(testMatrix.GetLength(0) != matrix.Rows || if(testMatrix.GetLength(0) != matrix.Rows ||
testMatrix.GetLength(1) != matrix.Columns) return false; testMatrix.GetLength(1) != matrix.Columns) return false;

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("MatrixProject.Test")] [assembly: System.Reflection.AssemblyCompanyAttribute("MatrixProject.Test")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+12d34f5c88cab82114d0839c74fb63606c53e1f1")]
[assembly: System.Reflection.AssemblyProductAttribute("MatrixProject.Test")] [assembly: System.Reflection.AssemblyProductAttribute("MatrixProject.Test")]
[assembly: System.Reflection.AssemblyTitleAttribute("MatrixProject.Test")] [assembly: System.Reflection.AssemblyTitleAttribute("MatrixProject.Test")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
4b30ebc250ee42c3b9faa54f23b0864a8e7ee790a1e18a0978b32da43b8dc4a1 07a74fdae5de3d8fdbd8f0eeea4af0b546026a6df884507ed58e9a6aa3b4633e