예제 #1
0
        public void Adding5lossesChangesPercentageTo45()
        {
            //Arrange
            HorseTip testAdd1 = new HorseTip("The Alamoney", RaceCourses.Ascot, new DateTime(2016, 03, 12), 1000.00m, false);
            HorseTip testAdd2 = new HorseTip("Holy Magoly", RaceCourses.Ayr, new DateTime(2016, 12, 02), 1000.00m, false);
            HorseTip testAdd3 = new HorseTip("Holy Magoly", RaceCourses.Ayr, new DateTime(2016, 12, 02), 1000.00m, false);
            HorseTip testAdd4 = new HorseTip("Holy Magoly", RaceCourses.Ayr, new DateTime(2016, 12, 02), 1000.00m, false);
            HorseTip testAdd5 = new HorseTip("Holy Magoly", RaceCourses.Ayr, new DateTime(2016, 12, 02), 1000.00m, false);

            dummyData.Add(testAdd1);
            dummyData.Add(testAdd2);
            dummyData.Add(testAdd3);
            dummyData.Add(testAdd4);
            dummyData.Add(testAdd5);

            string expected = GetSuccessRateReportString(18, 41, 44);


            //Act
            string successRate = ListEnquirer.GetSuccessRate(dummyData);

            //Assert
            Assert.IsTrue(successRate.Equals(expected));

            //Revert
            dummyData.Remove(testAdd1);
            dummyData.Remove(testAdd2);
            dummyData.Remove(testAdd3);
            dummyData.Remove(testAdd4);
            dummyData.Remove(testAdd5);
        }
예제 #2
0
        public void EighteenWinsOutOf36TipsEqualsASuccessRateOf50()
        {
            //Arrange
            string expected = GetSuccessRateReportString(18, 36, 50);
            //Act
            string successRate = ListEnquirer.GetSuccessRate(dummyData);

            //Assert
            Assert.IsTrue(successRate.Equals(expected));
        }
예제 #3
0
        public void PrintsNoDataWhenListIsNull()
        {
            //Arrange
            string          testList;
            List <HorseTip> nullTips = null;

            //Act
            testList = ListEnquirer.GetSuccessRate(nullTips);
            //Arrange
            Assert.IsTrue(testList.Equals("No data to display."));
        }
예제 #4
0
        public void PrintNoDataWhenListIsEmpty()
        {
            //Arrange
            string          testList;
            List <HorseTip> emptyTips = new List <HorseTip>();

            //Act
            testList = ListEnquirer.GetSuccessRate(emptyTips);
            //Arrange
            Assert.IsTrue(testList.Equals("No data to display."));
        }
예제 #5
0
 private void btnSuccRate_Click(object sender, EventArgs e)
 {
     MessageBox.Show(ListEnquirer.GetSuccessRate(HotTips.horseTips), "HotTipster Success Rate");
 }