Esempio n. 1
0
        public void AddResult_ShouldThrowArgumentException_withTwoSameResults()
        {
            var mockedResult = new Mock <IResult>();
            var resultType   = ResultType.Final;

            var match = new Logic.Models.Match(this.sport, this.league, this.date.AddDays(5), this.homeTeam, this.visitorTeam);

            match.AddResult(resultType, mockedResult.Object);

            Assert.That(
                () => match.AddResult(resultType, mockedResult.Object),
                Throws.ArgumentException.With.Message.Contains(EngineConstants.SameBetResultssForAMatchErrorMessage));
        }
Esempio n. 2
0
        public void AddResult_ShouldThrowArgumentNullException_withNullResult()
        {
            var match = new Logic.Models.Match(this.sport, this.league, this.date.AddDays(5), this.homeTeam, this.visitorTeam);

            Assert.That(
                () => match.AddResult(ResultType.Final, null),
                Throws.ArgumentNullException.With.Message.Contains(string.Format(EngineConstants.ObjectCannotBeNullErrorMessage, "Result")));
        }
Esempio n. 3
0
        public void AddResult_ShouldAddCorrectToCollection_withValidParams()
        {
            var mockedResult = new Mock <IResult>();

            var match = new Logic.Models.Match(this.sport, this.league, this.date.AddDays(5), this.homeTeam, this.visitorTeam);

            match.AddResult(ResultType.Final, mockedResult.Object);

            Assert.IsTrue(match.Results.ContainsValue(mockedResult.Object));
        }