Ejemplo n.º 1
0
        public async Task OneTimeSetUp()
        {
            _firstTask = VariantTask.CreateNew(
                "foo",
                FirstAnswer,
                new List <string> {
                "baz", "quuz", FirstAnswer
            },
                2);

            _secondTask = VariantTask.CreateNew(
                "bar",
                SecondAnswer,
                new List <string> {
                SecondAnswer, "quux", "baq"
            },
                2);

            _quiz = Quiz.CreateNew(QuizName, new List <VariantTask> {
                _firstTask, _secondTask
            });

            var unitOfWork = await DbSetUpFixture.GetUnitOfWorkAsync();

            await unitOfWork.Tasks.AddTaskAsync(_firstTask);

            await unitOfWork.Tasks.AddTaskAsync(_secondTask);

            await unitOfWork.Quizzes.AddQuizAsync(_quiz);

            await unitOfWork.SaveAsync();
        }
Ejemplo n.º 2
0
        public async Task OneTimeSetUp()
        {
            var unitOfWork = await DbSetUpFixture.GetUnitOfWorkAsync();

            _task = VariantTask.CreateNew(
                Question,
                Answer,
                new List <string> {
                A, B, C
            },
                2);

            await unitOfWork.Tasks.AddTaskAsync(_task);

            await unitOfWork.SaveAsync();
        }
Ejemplo n.º 3
0
        public async Task SetUp()
        {
            _context = await DbSetUpFixture.GetContextAsync();

            _unitOfWork = new UnitOfWork(_context);

            _personalInfo = new PersonalInfo(
                "John Doe",
                new DateTime(1970, 01, 01),
                "Over the Rainbow",
                "Believer",
                "Monsters inc.");

            _user = User.CreateNew(Email, Password, _personalInfo);

            await _unitOfWork.Users.AddUserAsync(_user);

            await _unitOfWork.SaveAsync();
        }
Ejemplo n.º 4
0
        public async Task OneTimeSetUp()
        {
            _unitOfWork = new UnitOfWork(await DbSetUpFixture.GetContextAsync());
            _user       = User.CreateNew(
                "email",
                "password",
                new PersonalInfo("John Doe", DateTime.UtcNow, "", "", ""));
            _quiz = Quiz.CreateNew(
                QuizName,
                new List <VariantTask>
            {
                VariantTask.CreateNew("foo", "bar", new List <string>(), 2),
                VariantTask.CreateNew("baz", "quux", new List <string>(), 2)
            });

            await _unitOfWork.Quizzes.AddQuizAsync(_quiz);

            await _unitOfWork.Users.AddUserAsync(_user);

            await _unitOfWork.SaveAsync();
        }
Ejemplo n.º 5
0
 public async Task SetUp()
 {
     _unitOfWork = await DbSetUpFixture.GetUnitOfWorkAsync();
 }