Exemplo n.º 1
0
        public void AsOfNow_UpUntilCurrentMinute_IncludesEventsAndStatistics()
        {
            //Arrange
            StubMatch.KickOff = DateTime.Now.AddMinutes(-15);
            var stubEvent = new ShotOnTarget(11, StubHomePlayer.Id, StubMatch.HomeTeam.Squad.Id);

            StubMatch.Events.Add(stubEvent);
            var stubStatistic = new MinuteStats(11, StubHomeSquad.Id, 0, 0);

            StubMatch.Statistics.Add(stubStatistic);

            //Act
            StubMatch.AsAtElapsed();

            //Assert
            Assert.Contains(StubMatch.Events, x => x == stubEvent);
            Assert.Contains(StubMatch.Statistics, x => x == stubStatistic);
        }
Exemplo n.º 2
0
        public void AsOfNow_OnOrAfterCurrentMinute_ExcludesEventsAndStatistics()
        {
            //Arrange
            StubMatch.KickOff = DateTime.Now.AddMinutes(-10);
            var stubEvent = new ShotOnTarget(StubHomePlayer.Id, StubMatch.HomeTeam.Squad.Id);

            StubMatch.Minutes[11].Events.Add(stubEvent);
            var stubStatistic = new MinuteStats(StubHomeSquad.Id, 0, 0);

            StubMatch.Minutes[11].Stats = stubStatistic;

            //Act
            StubMatch.AsAtElapsed();

            //Assert
            Assert.DoesNotContain(StubMatch.Minutes[11].Events, x => x == stubEvent);
            Assert.NotEqual(StubMatch.Minutes[11].Stats, stubStatistic);
        }
Exemplo n.º 3
0
        public void ShotOnTargetEventsAppearInTimeline()
        {
            var sot = new ShotOnTarget(0, new Guid(), new Guid());

            Assert.True(sot.ShowInTimeline);
        }
Exemplo n.º 4
0
        public void ShotOnTargetEventHasCorrectName()
        {
            var sot = new ShotOnTarget(0, new Guid(), new Guid());

            Assert.Equal("Shot Saved", sot.Name);
        }