Пример #1
0
        public void Given_TimeMarksMatrix_ShouldReturnExpected()
        {
            string[,] matrix = new string[6, 5];
            matrix[3, 3]     = "Simon";


            var groups = groupingService.GroupingStudents(matrix);

            Assert.NotNull(groups);
            Assert.NotNull(groups.First());
            Assert.True(groups.First().Leader == "Simon");
        }
Пример #2
0
        public async Task <IActionResult> Post()
        {
            // get post string from Request
            string rawString = await Request.GetRawBodyStringAsync();

            // convert string to timeMarksMatrix
            string[,] matrix = rawString.ToTimeMarksMatrix();

            // extract groups from timeMarksMatrix
            var groups = _groupingService.GroupingStudents(matrix);

            // format groups as response
            var response = _formattingService.Format(groups);

            // return
            return(Ok(response));
        }