BolfTracker.Infrastructure.EntityFramework.IntegrationTests.ObjectMother.CreateHoleStatistics C# (CSharp) 메소드

CreateHoleStatistics() 공개 정적인 메소드

public static CreateHoleStatistics ( BolfTracker.Models.Hole hole ) : BolfTracker.Models.HoleStatistics
hole BolfTracker.Models.Hole
리턴 BolfTracker.Models.HoleStatistics
        public static HoleStatistics CreateHoleStatistics(Hole hole)
        {
            return new HoleStatistics
            {
                Hole = hole,
                Month = DateTime.Today.Month,
                Year = DateTime.Today.Year,
                Attempts = 10,
                ShotsMade = 5,
                ShootingPercentage = .500M,
                PointsScored = 12,
                Pushes = 3,
                Steals = 2,
                SugarFreeSteals = 1
            };
        }

Usage Example

예제 #1
0
        public void Should_be_able_to_add_hole_statistics()
        {
            var hole = ObjectMother.CreateHole(Int32.MaxValue);

            _holeRepository.Add(hole);

            var holeStatistics = ObjectMother.CreateHoleStatistics(hole);

            _holeStatisticsRepository.Add(holeStatistics);

            Assert.AreNotEqual(0, holeStatistics.Id);
        }