示例#1
0
        public void I_can_calculate_campaign_prize_amount(string resource, int expected)
        {
            // retrieve text from embeded resource file.
            var assembly = Assembly.GetExecutingAssembly();
            var input    = new EmbededResource(assembly)
                           .Get(resource)
                           .ContentAsArray;

            var sut = new CampaignPrizeDraw(input);

            var prizeAmount = sut.CalculatePrizeAmount();

            Assert.AreEqual(expected, prizeAmount);
        }
示例#2
0
        public void system_throws_exception_for_invalid_number_of_days(string resource, string expected)
        {
            var assembly = Assembly.GetExecutingAssembly();
            var input    = new EmbededResource(assembly)
                           .Get(resource)
                           .ContentAsArray;


            var sut = new CampaignPrizeDraw(input);

            var ex = Assert.Throws <Exception>(() => sut.CalculatePrizeAmount());

            Assert.AreEqual(expected, ex.Message);
        }