private static DatabaseQuestion CreateDatabaseQuestion(int id, QuestionType type) { var question = new DatabaseQuestion { Id = id, Type = type, Theme = new DatabaseTheme { Discipline = ModelsCreationHelper.CreateDatabaseDiscipline(), ThemeTests = ModelsCreationHelper.CreateDatabaseTestThemes() } }; question.Theme.ThemeTests.ForEach(x => x.Test = new DatabaseTest { IsActive = true }); return(question); }
public async Task GetDiscipline() { RepositoryDiscipline .Setup(x => x.FindFirstAsync(It.IsAny <ISpecification <DatabaseDiscipline> >())) .ReturnsAsync(ModelsCreationHelper.CreateDatabaseDiscipline()); Context .Setup(x => x.GetCurrentUserAsync()) .ReturnsAsync(ModelsCreationHelper.CreateAdmin); await ServiceDiscipline.GetDisciplineAsync(999); Context .Setup(x => x.GetCurrentUserAsync()) .ReturnsAsync(ModelsCreationHelper.CreateLecturer); await ServiceDiscipline.GetDisciplineAsync(999); Context .Setup(x => x.GetCurrentUserAsync()) .ReturnsAsync(ModelsCreationHelper.CreateStudent); await ServiceDiscipline.GetDisciplineAsync(999); }