public void MultiplyByAddDivideThrowNotImplementedExceptionIfParameterIsNull() { var randomFloat = new FloatNumberMatrixData((float)new Random().NextDouble()); Assert.Throws <NotImplementedException>(() => { randomFloat.MultiplyBy(null); }); Assert.Throws <NotImplementedException>(() => { randomFloat.Add(null); }); Assert.Throws <NotImplementedException>(() => { randomFloat.Divide(null); }); }
public void ReturningCorrectResultWhenMultiplyByWithFloatNumberMatrixData() { var random = new Random(); var randomNumber = (float)random.NextDouble(); var secondRandomNumber = (float)random.NextDouble(); var first = new FloatNumberMatrixData(randomNumber); var second = new FloatNumberMatrixData(secondRandomNumber); var multiplicationResult = first.MultiplyBy(second); AssertFloatsAreEqual(randomNumber * secondRandomNumber, (float)multiplicationResult.RawValue); }