private async Task <Team> CreateTeam() { var city = await TestApi.CreateCity(); var teamLead = await TestApi.CreateUser(); return(await TestApi.CreateTeam(teamLead, city)); }
protected Tests() { var context = new ContainerBuilder(); context.RegisterModule <AutofacModule>(); var options = new DbContextOptionsBuilder <DatabaseContext>() .UseSqlServer(ConnectionString) .Options; context.RegisterType <DatabaseContext>().AsSelf().InstancePerLifetimeScope(); context.RegisterInstance(options); context.RegisterType <TestApi>(); _container = context.Build(); _lifetimeScope = _container.BeginLifetimeScope(); Bus = _container.Resolve <IBus>(); TestApi = _container.Resolve <TestApi>(); }
public async Task InitializeAsync() { var teamLead = await TestApi.CreateUser(); var city = await TestApi.CreateCity(); var team = await TestApi.CreateTeam(teamLead, city); _firstQuestion = new GeneralQuestion { Title = "How are you?", Description = "Please, describe your filling.", OrderIndex = 0, MaxAnswerSeconds = 60 }; _secondQuestion = new InputQuestion { Title = "1 + 2", Description = "Please answer:", OrderIndex = 1, CorrectAnswer = "3", MaxAnswerSeconds = 60 }; _thirdQuestion = new SelectQuestion { Title = "1 + 3", Description = "Please select one of the following:", OrderIndex = 2, Options = new[] { new Option { Title = "4", IsCorrect = false }, new Option { Title = "5", IsCorrect = false }, new Option { Title = "4.0", IsCorrect = true } }, OneCorrectAnswer = true, MaxAnswerSeconds = 60 }; var jobPosition = new JobPosition { Title = UniqueUtils.MakeUnique("Junior Java Developer"), Template = new Template { Description = "Please, answer on questions", Questions = new Question[] { _firstQuestion, _secondQuestion, _thirdQuestion } } }; jobPosition.Id = (await Bus.Request(new CreateJobPosition { JobPosition = jobPosition })) .JobPositionId; _vacancyId = (await TestApi.CreateVacancy(jobPosition, team)).Id.Value; }
public async Task InitializeAsync() { _jobPositionId = (await TestApi.CreateJobPosition()).Id.Value; _teamId = (await CreateTeam()).Id.Value; }