コード例 #1
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();
        }
コード例 #2
0
ファイル: SessionTests.cs プロジェクト: gtoru/server
        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();
        }