Exemple #1
0
        public async Task AddAssignmentAsync_ValidData_ReturnsAssignment()
        {
            // Arrange
            var        service    = new AssignmentService(dbContext);
            Assignment assignment = new Assignment {
                Id = 5, Name = "Set A", Title = "A", Description = "", Type = "Easy", Duration = 30, Tags = new[] { "c#", ".Net" }
            },

            // Act
                       response = await service.AddAssignmentAsync(assignment);

            dbContext.Dispose();

            // Assert
            Assert.NotNull(response);
        }
        public async Task <IActionResult> AddAssignmentAsync([FromBody] dynamic model)
        {
            var result = await _assignmentService.AddAssignmentAsync(model);

            return(Json(result));
        }