public void Test1(TaskFunction taskFunction) { var subject = taskFunction.GetSubject <int[][]>(2); subject.Should().NotBeNull(); var line = subject[0]; line.Should().BeEquivalentTo(new[] { 1, 2 }); line = subject[1]; line.Should().BeEquivalentTo(new[] { 0, 1 }); }
public void Test1(TaskFunction taskFunction) { var matrix = new [, ] { { 1, 2, 3, 4 }, { 1, 2, 3, 4 }, { 1, 2, 3, 4 }, { 1, 2, 3, 4 }, }; var subject = taskFunction.GetSubject <IMatrix>(matrix); subject.MainDiagonal.Should().BeEquivalentTo(new[] { 1, 2, 3, 4 }); subject.SideDiagonal.Should().BeEquivalentTo(new [] { 1, 2, 3, 4 }); }
public void Test2(TaskFunction taskFunction) { var matrix = new[, ] { { 1, 2, 3, 9 }, { 1, 4, 8, 10 }, { 5, 7, 11, 14 }, { 6, 12, 13, 15 }, }; var subject = taskFunction.GetSubject <IMatrix>(matrix); subject.MainDiagonal.Should().BeEquivalentTo(new[] { 1, 4, 11, 15 }); subject.SideDiagonal.Should().BeEquivalentTo(new[] { 6, 7, 8, 9 }); }
public void Test2(TaskFunction taskFunction) { var subject = taskFunction.GetSubject <int[][]>(5); subject.Should().NotBeNull(); var line = subject[0]; line.Should().BeEquivalentTo(new[] { 1, 2, 3, 4, 5 }); line = subject[1]; line.Should().BeEquivalentTo(new[] { 0, 1, 2, 3, 4 }); line = subject[2]; line.Should().BeEquivalentTo(new[] { 0, 0, 1, 2, 3 }); line = subject[3]; line.Should().BeEquivalentTo(new[] { 0, 0, 0, 1, 2 }); line = subject[4]; line.Should().BeEquivalentTo(new[] { 0, 0, 0, 0, 1 }); }
public void Test(TaskFunction taskFunction) { var subject = taskFunction.GetSubject <int[][]>(5); subject.Should().NotBeNull(); var line = subject[0]; line.Should().BeEquivalentTo(new[] { 1, 3, 4, 10, 11 }); line = subject[1]; line.Should().BeEquivalentTo(new[] { 2, 5, 9, 12, 19 }); line = subject[2]; line.Should().BeEquivalentTo(new[] { 6, 8, 13, 18, 20 }); line = subject[3]; line.Should().BeEquivalentTo(new[] { 15, 16, 22, 23, 25 }); line = subject[4]; line.Should().BeEquivalentTo(new[] { 1, 2, 3, 4, 5 }); }
public void Test1_Numbers(TaskFunction taskFunction) { var subject = taskFunction.GetSubject <string>("0123 0456 078910"); subject.Should().Be("123 456 78910"); }
public void Test2_Hamlet(TaskFunction taskFunction) { var subject = taskFunction.GetSubject <string>("To be, or not to be, that is the question."); subject.Should().Be("o e, r ot o e, hat s he uestion."); }