Exemplo n.º 1
0
        public void CheckResultYieldsAppropriateOutcome(int checkTotal, int dieValue, string expectedOutcome)
        {
            CheckOutcome outcome       = new CheckOutcome(difficultyClass, checkTotal, dieValue);
            string       outcomeReport = outcome.RetrieveOutcomeReport();

            Assert.That(outcomeReport, Is.EqualTo(expectedOutcome));
        }
Exemplo n.º 2
0
        public CheckResult(
            CheckBase check,
            DateTimeOffset time,
            CheckOutcome outcome,
            IReadOnlyCollection <ConditionResultDetail> details)
        {
            if (outcome == default(CheckOutcome))
            {
                throw new ArgumentOutOfRangeException(nameof(outcome));
            }

            Check   = check ?? throw new ArgumentNullException(nameof(check));
            Time    = time;
            Outcome = outcome;
            Details = details ?? throw new ArgumentNullException(nameof(details));

            if (Details.Any(d => d == null))
            {
                throw new ArgumentException("details contains a null");
            }
        }