示例#1
0
        public async Task OneTimeSetUp()
        {
            var factory = new LocalWebApplicationFactory();
            var client  = factory.CreateClient();

            await AuthenticateAdminAsync(client);

            var taskRequest = new CreateTaskRequest
            {
                Answer   = "42",
                Question = "Meaning of life",
                Weight   = 2,
                Variants = new List <string> {
                    "foo", "bar", "42"
                }
            };

            _firstTask = await client.CreateTaskAsync(taskRequest);

            _secondTask = await client.CreateTaskAsync(taskRequest);

            var quizRequest = new CreateQuizRequest
            {
                QuizName = QuizName,
                Tasks    = new List <Guid> {
                    _firstTask, _secondTask
                }
            };

            _firstQuiz = await client.CreateQuizAsync(quizRequest);

            _secondQuiz = await client.CreateQuizAsync(quizRequest);
        }
示例#2
0
 public void SetUp()
 {
     _factory = new LocalWebApplicationFactory();
     Client   = _factory.CreateClient();
 }
示例#3
0
        public void SetUp()
        {
            var factory = new LocalWebApplicationFactory();

            _client = factory.CreateClient();
        }