public void Should_SerializeToJson_ForStandardInput() { //arrange int dimensions = 2; IJsonSerializationProvider jsonSerializationProvider = A.Fake <IJsonSerializationProvider>(); IMatrixProvider matrixProvider = new MatrixProvider(jsonSerializationProvider, dimensions); //act matrixProvider.SerializeToJson(); //assert A.CallTo(() => jsonSerializationProvider.Serialize(null)).WithAnyArguments().MustHaveHappened(); }
public void Should_LowerUpperFactorization_ForStandardInput() { //arrange int dimensions = 2; double[] ratings = new double[] { 0.5, 0.5 }; double[] expectedOutput = new double[] { 0.25, 0.25 }; IJsonSerializationProvider jsonSerializationProvider = A.Fake <IJsonSerializationProvider>(); IMatrixProvider matrixProvider = new MatrixProvider(jsonSerializationProvider, dimensions); //act matrixProvider.SerializeToJson(); IEnumerable <double> actualOutput = matrixProvider.LowerUpperFactorizeAndSolve(ratings); //assert actualOutput.Should().BeEquivalentTo(expectedOutput); }