add test for fill
This commit is contained in:
parent
12d34f5c88
commit
1bd4c3038a
Binary file not shown.
Binary file not shown.
@ -2,10 +2,6 @@
|
||||
"Version": 1,
|
||||
"WorkspaceRootPath": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\",
|
||||
"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}",
|
||||
"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}",
|
||||
"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": [
|
||||
@ -22,46 +22,44 @@
|
||||
"DocumentGroups": [
|
||||
{
|
||||
"DockedWidth": 200,
|
||||
"SelectedChildIndex": 0,
|
||||
"SelectedChildIndex": 1,
|
||||
"Children": [
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 0,
|
||||
"Title": "MatrixProject.Test",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "MatrixProject.Test.csproj",
|
||||
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"RelativeToolTip": "MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
|
||||
"WhenOpened": "2024-10-08T07:03:47.001Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2024-10-08T07:03:47.001Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 1,
|
||||
"DocumentIndex": 0,
|
||||
"Title": "MatrixTest.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs",
|
||||
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixTest.cs",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs*",
|
||||
"RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs*",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAA4AAAAZAAAAAAAAAA==",
|
||||
"ViewState": "AgIAABkAAAAAAAAAAAAAACAAAAAvAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-10-08T06:41:24.991Z",
|
||||
"EditorCaption": ""
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"DocumentIndex": 1,
|
||||
"Title": "Matrix.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs",
|
||||
"RelativeDocumentMoniker": "MatrixProject\\Matrix.cs",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs*",
|
||||
"RelativeToolTip": "MatrixProject\\Matrix.cs*",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAABgAAAAIAAAAAAAAAA==",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject\\Matrix.cs",
|
||||
"RelativeToolTip": "MatrixProject\\Matrix.cs",
|
||||
"ViewState": "AgIAABYAAAAAAAAAAAAqwAsAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-10-08T06:36:26.85Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2024-10-08T06:36:26.85Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -27,15 +27,14 @@
|
||||
{
|
||||
"$type": "Document",
|
||||
"DocumentIndex": 2,
|
||||
"Title": "MatrixProject.Test",
|
||||
"Title": "MatrixProject.Test.csproj",
|
||||
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"RelativeToolTip": "MatrixProject.Test\\MatrixProject.Test.csproj",
|
||||
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
|
||||
"WhenOpened": "2024-10-08T07:03:47.001Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2024-10-08T07:03:47.001Z"
|
||||
},
|
||||
{
|
||||
"$type": "Document",
|
||||
@ -43,9 +42,9 @@
|
||||
"Title": "MatrixTest.cs",
|
||||
"DocumentMoniker": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs",
|
||||
"RelativeDocumentMoniker": "MatrixProject.Test\\MatrixTest.cs",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs",
|
||||
"RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs",
|
||||
"ViewState": "AgIAABcAAAAAAAAAAAAAABsAAAA0AAAAAAAAAA==",
|
||||
"ToolTip": "C:\\Users\\Hackaton\\source\\repos\\MatrixSolution\\MatrixSol\\MatrixProject.Test\\MatrixTest.cs*",
|
||||
"RelativeToolTip": "MatrixProject.Test\\MatrixTest.cs*",
|
||||
"ViewState": "AgIAABYAAAAAAAAAAAAAACAAAAA6AAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-10-08T06:41:24.991Z",
|
||||
"EditorCaption": ""
|
||||
@ -60,8 +59,7 @@
|
||||
"RelativeToolTip": "MatrixProject\\Matrix.cs",
|
||||
"ViewState": "AgIAABYAAAAAAAAAAAAqwAsAAAAAAAAAAAAAAA==",
|
||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
|
||||
"WhenOpened": "2024-10-08T06:36:26.85Z",
|
||||
"EditorCaption": ""
|
||||
"WhenOpened": "2024-10-08T06:36:26.85Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Binary file not shown.
@ -1,3 +1,5 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace MatrixProject.Test;
|
||||
|
||||
public class MatrixTest
|
||||
@ -24,23 +26,21 @@ public class MatrixTest
|
||||
Assert.Equal(5, matrix.Columns);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckFillMatrixInDefaultConstructor() {
|
||||
[Theory]
|
||||
[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[,] {
|
||||
{ 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));
|
||||
Assert.True(EqualsTwoDimArray(testArray, 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) {
|
||||
if(testMatrix.GetLength(0) != matrix.Rows ||
|
||||
testMatrix.GetLength(1) != matrix.Columns) return false;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("MatrixProject.Test")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[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.AssemblyTitleAttribute("MatrixProject.Test")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
4b30ebc250ee42c3b9faa54f23b0864a8e7ee790a1e18a0978b32da43b8dc4a1
|
||||
07a74fdae5de3d8fdbd8f0eeea4af0b546026a6df884507ed58e9a6aa3b4633e
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user