public EvaluationDataController(
     ILogger <EvaluationDataController> logger,
     SUGARContextFactory contextFactory,
     EvaluationDataCategory category)
 {
     _logger   = logger;
     _category = category;
     _evaluationDataDbController = new EntityFramework.Controllers.EvaluationDataController(contextFactory, category);
 }
        public void DoesDeleteEvaluationDataWhenUserDeleted(EvaluationDataCategory category)
        {
            // Arrange
            var user = Helpers.CreateUser($"{nameof(DoesDeleteEvaluationDataWhenUserDeleted)}_{category}");

            var datas = Enumerable.Range(0, 10).Select(i => new EvaluationData
            {
                Key                = nameof(DoesDeleteEvaluationDataWhenUserDeleted),
                ActorId            = user.Id,
                Category           = category,
                EvaluationDataType = EvaluationDataType.Long
            }).ToList();

            _evaluationDataController.Create(datas);

            // Act
            _userController.Delete(user.Id);

            // Assert
            var createdDatas = _evaluationDataController.GetActorData(user.Id);

            Assert.Empty(createdDatas);
        }
Ejemplo n.º 3
0
 public static IQueryable <EvaluationData> GetCategoryData(this SUGARContext context, EvaluationDataCategory category)
 {
     return(context.EvaluationData.Where(data => data.Category == category));
 }
Ejemplo n.º 4
0
 public EvaluationDataController(SUGARContextFactory contextFactory, EvaluationDataCategory category)
     : base(contextFactory)
 {
     _category = category;
 }