コード例 #1
0
        public void AddResult()
        {
            Random random = new Random();

            var meeting = new Meeting {
                Date = DateTime.Now
            };

            _meetingsManager.AddMeeting(meeting);
            Assert.NotNull(meeting);

            var discipline = _disciplinesManager.GetDisciplinesAsync().Single(d => d.Name == "3x3");

            var maxim = _usersManager.GetUsers(false).Single(u => u.FirstName == "Aleksandr" && u.LastName == "Omelchenko");

            Result result;

            // add valid
            result = new Result
            {
                Attempts   = Attempts(random.Next(1, 100), random.Next(1, 100), random.Next(1, 100), random.Next(1, 100), random.Next(1, 100)),
                Discipline = discipline,
                User       = maxim
            };

            TestAddResult(meeting, result);

            // 2x2
            discipline = _disciplinesManager.GetDisciplinesAsync().Single(d => d.Name == "2x2");

            // add valid
            result = new Result
            {
                Attempts   = Attempts(random.Next(1, 100), random.Next(1, 100), random.Next(1, 100)),
                Discipline = discipline,
                User       = maxim
            };

            TestAddResult(meeting, result);
        }
コード例 #2
0
 public IEnumerable <Discipline> Get()
 {
     return(_disciplinesManager.GetDisciplinesAsync());
 }