public void Test_GetRandomLongTwice_ShouldReturnDiffValue() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var randomLong1 = RandomValueGen.GetRandomLong(); var randomLong2 = RandomValueGen.GetRandomLong(); //---------------Test Result ----------------------- Assert.AreNotEqual(randomLong1, randomLong2); }
public void Test_GetRandomLong_WithNoMaxAndMin_ShouldReturnRandomLong() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var randomLong = RandomValueGen.GetRandomLong(); //---------------Test Result ----------------------- Assert.GreaterOrEqual(randomLong, GetMin <long>(), "Should return value greater than min"); Assert.LessOrEqual(randomLong, GetMax <long>(), "Should return value less than min"); }
public void Test_GetRandomLong_WithMaxAndMinAsInts_ShouldReturnRandomLong() { //---------------Set up test pack------------------- var min = GetMin <int>(); var max = GetMax <int>(); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var randomLong = RandomValueGen.GetRandomLong(min, max); //---------------Test Result ----------------------- Assert.GreaterOrEqual(randomLong, min, "Should be greater than min"); Assert.LessOrEqual(randomLong, max, "should be less than max"); }
public void Test_GetRandomLong_WithMaxLTMin_ShouldReturnMin() { //---------------Set up test pack------------------- var min = GetMax <int>() - 100; var max = GetMax <int>() - 500; //---------------Assert Precondition---------------- Assert.Less(max, min); //---------------Execute Test ---------------------- var randomLong = RandomValueGen.GetRandomLong(min, max); //---------------Test Result ----------------------- Assert.AreEqual(randomLong, min); }