@@ -6,55 +6,63 @@ public class MatrixTests
66 public void Extract_row_from_one_number_matrix ( )
77 {
88 var sut = new Matrix ( "1" ) ;
9- Assert . Equal ( new [ ] { 1 } , sut . Row ( 1 ) ) ;
9+ int [ ] expected = [ 1 ] ;
10+ Assert . Equal ( expected , Matrix . Row ( 1 ) ) ;
1011 }
1112
1213 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
1314 public void Can_extract_row ( )
1415 {
1516 var sut = new Matrix ( "1 2\n 3 4" ) ;
16- Assert . Equal ( new [ ] { 3 , 4 } , sut . Row ( 2 ) ) ;
17+ int [ ] expected = [ 3 , 4 ] ;
18+ Assert . Equal ( expected , Matrix . Row ( 2 ) ) ;
1719 }
1820
1921 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
2022 public void Extract_row_where_numbers_have_different_widths ( )
2123 {
2224 var sut = new Matrix ( "1 2\n 10 20" ) ;
23- Assert . Equal ( new [ ] { 10 , 20 } , sut . Row ( 2 ) ) ;
25+ int [ ] expected = [ 10 , 20 ] ;
26+ Assert . Equal ( expected , Matrix . Row ( 2 ) ) ;
2427 }
2528
2629 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
2730 public void Can_extract_row_from_non_square_matrix_with_no_corresponding_column ( )
2831 {
2932 var sut = new Matrix ( "1 2 3\n 4 5 6\n 7 8 9\n 8 7 6" ) ;
30- Assert . Equal ( new [ ] { 8 , 7 , 6 } , sut . Row ( 4 ) ) ;
33+ int [ ] expected = [ 8 , 7 , 6 ] ;
34+ Assert . Equal ( expected , Matrix . Row ( 4 ) ) ;
3135 }
3236
3337 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
3438 public void Extract_column_from_one_number_matrix ( )
3539 {
3640 var sut = new Matrix ( "1" ) ;
37- Assert . Equal ( new [ ] { 1 } , sut . Column ( 1 ) ) ;
41+ int [ ] expected = [ 1 ] ;
42+ Assert . Equal ( expected , Matrix . Column ( 1 ) ) ;
3843 }
3944
4045 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
4146 public void Can_extract_column ( )
4247 {
4348 var sut = new Matrix ( "1 2 3\n 4 5 6\n 7 8 9" ) ;
44- Assert . Equal ( new [ ] { 3 , 6 , 9 } , sut . Column ( 3 ) ) ;
49+ int [ ] expected = [ 3 , 6 , 9 ] ;
50+ Assert . Equal ( expected , Matrix . Column ( 3 ) ) ;
4551 }
4652
4753 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
4854 public void Can_extract_column_from_non_square_matrix_with_no_corresponding_row ( )
4955 {
5056 var sut = new Matrix ( "1 2 3 4\n 5 6 7 8\n 9 8 7 6" ) ;
51- Assert . Equal ( new [ ] { 4 , 8 , 6 } , sut . Column ( 4 ) ) ;
57+ int [ ] expected = [ 4 , 8 , 6 ] ;
58+ Assert . Equal ( expected , Matrix . Column ( 4 ) ) ;
5259 }
5360
5461 [ Fact ( Skip = "Remove this Skip property to run this test" ) ]
5562 public void Extract_column_where_numbers_have_different_widths ( )
5663 {
5764 var sut = new Matrix ( "89 1903 3\n 18 3 1\n 9 4 800" ) ;
58- Assert . Equal ( new [ ] { 1903 , 3 , 4 } , sut . Column ( 2 ) ) ;
65+ int [ ] expected = [ 1903 , 3 , 4 ] ;
66+ Assert . Equal ( expected , Matrix . Column ( 2 ) ) ;
5967 }
6068}
0 commit comments