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 ReturningCorrectResultWhenAddWithFloatNumberMatrixData() { 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 additionResult = first.Add(second); AssertFloatsAreEqual(randomNumber + secondRandomNumber, (float)additionResult.RawValue); }