public void Invert_NonzeroIndex_ReturnsExpectedIndex() { int index = 7; int result = HammersleySequence.Invert(hammersleySequence3DBase16[index], 16); Assert.That(result, Is.EqualTo(index)); }
public void GetElement_3DNonzeroIndex_ReturnsExpectedElement() { int index = 10; double[] result = HammersleySequence.GetElement(3, 16, index); Assert.That(result, Is.EqualTo(hammersleySequence3DBase16[index]).Within(6E-7)); }
public void Next_3DZeroSeed_ReturnsExpectedSequence() { int count = 11; HammersleySequence sequence = new HammersleySequence(3, 16); double[][] result = new double[count][]; for (int i = 0; i < count; i++) { result[i] = sequence.Next(); } Assert.That(result, Is.EqualTo(hammersleySequence3DBase16).Within(6E-7)); }
public void GetElement_InvalidDimensions_Throws() { Assert.That(() => HammersleySequence.GetElement(0, 16, 0), Throws.ArgumentException); }
public void GetElement_InvalidBase_Throws() { Assert.That(() => HammersleySequence.GetElement(1, 0, 0), Throws.ArgumentException); }
public void GetElement_InvalidIndex_Throws() { Assert.That(() => HammersleySequence.GetElement(1, 16, -1), Throws.ArgumentException); }
public void Invert_NonrationalNumber_Overflows() { Assert.That(() => HammersleySequence.Invert(new double[] { 1.0 / Math.PI, 1.0 / Math.E }, 16), Throws.TypeOf <OverflowException>()); }
public void Invert_ValuesTooLarge_Throws() { Assert.That(() => HammersleySequence.Invert(new double[] { 2.0, 4.0, 8.0 }, 0), Throws.ArgumentException); }
public void Invert_InvalidBase_Throws() { Assert.That(() => HammersleySequence.Invert(hammersleySequence3DBase16[1], 0), Throws.ArgumentException); }
public void Invert_EmptyElement_Throws() { Assert.That(() => HammersleySequence.Invert(new double[0], 16), Throws.ArgumentException); }
public void Invert_ElementIsNull_Throws() { Assert.That(() => HammersleySequence.Invert(null, 16), Throws.ArgumentNullException); }
public void Constructor_InvalidDimensions_Throws() { Assert.That(() => HammersleySequence.GetElement(1, 16, -1), Throws.ArgumentException); }