Пример #1
0
        public void TestContract6()
        {
            //Arrange
            var module   = new ContractScoreCalculatorModule();
            var contract = new Contract("3H", PlayerPosition.South);
            //Act
            var score  = module.CalculateScore(contract, 10, SysVulnerabilityEnum.EW);
            var score2 = module.CalculateScore(contract, "+1", SysVulnerabilityEnum.EW);

            //Assert
            Assert.AreEqual(170, score);
            Assert.AreEqual(170, score2);
        }
Пример #2
0
        public void TestContract4()
        {
            //Arrange
            var module   = new ContractScoreCalculatorModule();
            var contract = new Contract("1NT", PlayerPosition.West);
            //Act
            var score  = module.CalculateScore(contract, 9, SysVulnerabilityEnum.All);
            var score2 = module.CalculateScore(contract, "+2", SysVulnerabilityEnum.All);

            //Assert
            Assert.AreEqual(-150, score);
            Assert.AreEqual(-150, score2);
        }
Пример #3
0
        public void TestContract19()
        {
            //Arrange
            var module   = new ContractScoreCalculatorModule();
            var contract = new Contract("4SX", PlayerPosition.North);
            //Act
            var score  = module.CalculateScore(contract, 7, SysVulnerabilityEnum.All);
            var score2 = module.CalculateScore(contract, "-3", SysVulnerabilityEnum.All);

            //Assert
            Assert.AreEqual(-800, score);
            Assert.AreEqual(-800, score2);
        }
Пример #4
0
        public void TestContract17()
        {
            //Arrange
            var module   = new ContractScoreCalculatorModule();
            var contract = new Contract("Pass", PlayerPosition.North);
            //Act
            var score  = module.CalculateScore(contract, 0, SysVulnerabilityEnum.EW);
            var score2 = module.CalculateScore(contract, string.Empty, SysVulnerabilityEnum.EW);

            //Assert
            Assert.AreEqual(0, score);
            Assert.AreEqual(0, score2);
        }
Пример #5
0
        public void TestContract16()
        {
            //Arrange
            var module   = new ContractScoreCalculatorModule();
            var contract = new Contract("3NT", PlayerPosition.North);
            //Act
            var score  = module.CalculateScore(contract, 9, SysVulnerabilityEnum.EW);
            var score2 = module.CalculateScore(contract, "=", SysVulnerabilityEnum.EW);

            //Assert
            Assert.AreEqual(400, score);
            Assert.AreEqual(400, score2);
        }
Пример #6
0
        public void TestContract15()
        {
            //Arrange
            var module   = new ContractScoreCalculatorModule();
            var contract = new Contract("4H", PlayerPosition.East);
            //Act
            var score  = module.CalculateScore(contract, 11, SysVulnerabilityEnum.NS);
            var score2 = module.CalculateScore(contract, "+1", SysVulnerabilityEnum.NS);

            //Assert
            Assert.AreEqual(-450, score);
            Assert.AreEqual(-450, score2);
        }