public void testGetNorthSouthIMPContractContract() { Contract contractA = new Contract(); contractA.Level = 4; contractA.Player = Direction.West; contractA.Doubled = true; contractA.ReDoubled = false; contractA.Suit = Suit.Diamonds; contractA.Tricks = 7; Contract contractB = new Contract(); contractB.Level = 4; contractB.Player = Direction.West; contractB.Doubled = true; contractB.ReDoubled = false; contractB.Suit = Suit.Diamonds; contractB.Tricks = 8; int northIMP = IMPCalculator.GetNorthSouthIMP(boardNotVulnerable, contractA, contractB); Assert.Equal(5, northIMP); }
public static int GetIMP(int result, int HCP, bool vulnerable, bool opponentsVulnerable) { int expectedResult = GetExpectedResult(HCP, result > 0 ? vulnerable : opponentsVulnerable); return(IMPCalculator.GetNorthSouthIMP(result, expectedResult)); // return result >= expectedResult ? IMPs * -1 in IMPs; }
public void testGetNorthSouthIMPIntInt_8000_equals_24() { int actual = IMPCalculator.GetNorthSouthIMP(8000, 0); Assert.Equal(24, actual); }
public void testGetNorthSouthIMPIntInt_490_equals_10() { int actual = IMPCalculator.GetNorthSouthIMP(800, 310); Assert.Equal(10, actual); }
public void testGetNorthSouthIMPIntInt_3990_equals_23() { int actual = IMPCalculator.GetNorthSouthIMP(4010, 20); Assert.Equal(23, actual); }
public void testGetNorthSouthIMPIntInt_10_equals_0() { int actual = IMPCalculator.GetNorthSouthIMP(430, 420); Assert.Equal(0, actual); }
public void testGetNorthSouthIMPIntInt_minus100_equals_minus3() { int actual = IMPCalculator.GetNorthSouthIMP(200, 300); Assert.Equal(-3, actual); }
public void testGetNorthSouthIMPIntInt_100_equals_3() { int actual = IMPCalculator.GetNorthSouthIMP(200, 100); Assert.Equal(3, actual); }