Пример #1
0
        public void IsCorrectMultiplyingTest(int[,] left, int[,] right, int[,] expected, int numberOfTestCase)
        {
            var threads = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100 };

            if (typeof(T) == typeof(StripedParallelizingMatrixMultiplier) ||
                typeof(T) == typeof(SequentiallyParallelizingMatrixMultiplier))
            {
                foreach (var thread in threads)
                {
                    multiplier = typeof(T) == typeof(StripedParallelizingMatrixMultiplier)
                        ? new StripedParallelizingMatrixMultiplier(thread)
                        : new SequentiallyParallelizingMatrixMultiplier(thread) as IMatrixMultiplier;

                    var result = multiplier.Multiply(left, right);

                    Assert.IsTrue(FunctionsOnMatrices.AreEqual(result, expected));
                }

                return;
            }

            var actualResult = multiplier.Multiply(left, right);

            Assert.IsTrue(FunctionsOnMatrices.AreEqual(actualResult, expected));
        }
Пример #2
0
        public async Task IsCorrectReadingMatrixFromFileTest(int[,] expected, string readingPath)
        {
            var actual = await fileReader.ReadAsync(readingPath);

            Assert.IsTrue(FunctionsOnMatrices.AreEqual(expected, actual));
        }