public void MathFunctionCSV_NotNaN_ReturnsTrue(int x) { // Arrange var obj = new MethodLibrary(); // Act var ret = obj.MathFunction(x ); // Assert Assert.AreNotEqual(ret, Double.NaN); }
public void MathFunctionCSV_Within0To1_ReturnsTrue(int x) { // Arrange var obj = new MethodLibrary(); // Act var ret = obj.MathFunction(x); var res = ret <= 1 & ret > 0; // Assert Assert.IsTrue(res); }
public void MathFunctionHardcode_DivideByZeroException_ShouldBeThrown() { // Arrange var obj = new MethodLibrary(); // Act Func<object> result = () => obj.MathFunction(1); // Assert result.Should().Throw<DivideByZeroException>(); }
public void MethodLibrary_ShouldRun100Times_Success() { // Arrange var obj = new MethodLibrary(); var rand = new Random(); var num = rand.Next(2, 5); // Act Console.WriteLine(num); var ret = obj.MathFunction( num ); Console.WriteLine(ret); // Assert Assert.AreNotEqual(ret, Double.NaN); }
public void MathFunctionRandom_NotNaN_ReturnsTrue() { // Arrange var obj = new MethodLibrary(); var rand = new Random(); var num = rand.Next(2, 5); // Act Console.WriteLine(num); var ret = obj.MathFunction( num ); Console.WriteLine(ret); // Assert Assert.AreNotEqual(ret, Double.NaN); }
public void MathFunctionRandom__Within0To1_ReturnsTrue() { // Arrange var obj = new MethodLibrary(); var rand = new Random(); var num = rand.Next(5); // Act Console.WriteLine(num); var ret = obj.MathFunction(5 ); var res = ret <= 1 & ret > 0; // Assert Assert.IsTrue(res); }