public async Task Should_Register_User() { IMatrixClient client = new MatrixClient( Fixture.Settings.Server ); PaginatedResponse <PublicRoomsChunk> response = await client.MakeRequestAsync( new ListPublicRoomsRequest { Limit = 8 } ); Assert.Null(response.PrevBatch); Assert.NotEmpty(response.NextBatch); if (response.TotalRoomCountEstimate != null) { Assert.True( 0 < response.TotalRoomCountEstimate, "Rooms count estimate should be greater than 0." ); } Assert.NotNull(response.Chunk); Assert.Equal(8, response.Chunk.Count()); foreach (PublicRoomsChunk roomChunk in response.Chunk) { MatrixAssert.ValidRoomChunk(roomChunk); } }
public void CovarianceMatrix_CalculatesCorrectly() { var actualMatrix = inputMatrix.CovarianceMatrix(); var expectedArray = new double[, ] { { 18.3, 4.35, -4.95 }, { 4.35, 14.2, 5.85 }, { -4.95, 5.85, 7.3 } }; var expectedMatrix = Matrix <double> .Build.DenseOfArray(expectedArray); MatrixAssert.AreAlmostEqual(expectedMatrix, actualMatrix, 2); }