Beispiel #1
0
        public void Setup()
        {
            _db              = A.Fake <IDapper>();
            _dbRepository    = new Repository(_db);
            _talksController = new TalksController(_dbRepository);

            _expectedTalk = TalkEntityBuilder.BuildTalkEntityById(_talkId, _easyAccessKey);
        }
        public void Setup()
        {
            _db                      = A.Fake <IDapper>();
            _dbRepository            = new Repository(_db);
            _feedbackFormsController = new FeedbackFormController(_dbRepository);

            _expectedTalkDTO       = TalkEntityBuilder.BuildTalkEntityById(_expectedTalkId, _expectedEasyAccessKey);
            _expectedQuestionnaire = FeedbackFormBuilder.GetQuestionnaireAsJson();
        }
Beispiel #3
0
        public int InsertTalk(TalkEntity talkDTO)
        {
            var query = @"
                INSERT INTO `Talks` 
                (EasyAccessKey,Name,Topic,
                Description,SpeakerName,TalkCreationTime,
                TalkStartTime,QuestionnaireId)
                VALUES 
                (@EasyAccessKey,@Name,@Topic,
                @Description,@SpeakerName,@TalkCreationTime,
                @TalkStartTime,@QuestionnaireId);
                SELECT LAST_INSERT_ID()";

            return(_dapper.Query <int>(query, talkDTO).FirstOrDefault());
        }
        public void Setup()
        {
            _db              = A.Fake <IDapper>();
            _dbRepository    = new Repository(_db);
            _talksController = new TalksController(_dbRepository);

            _expectedTalk1 = TalkEntityBuilder.BuildTalkEntityById(1, "key_1");
            _expectedTalk2 = TalkEntityBuilder.BuildTalkEntityById(2, "key_2");
            _expectedTalk3 = TalkEntityBuilder.BuildTalkEntityById(3, "key_3");
            _expectedTalk4 = TalkEntityBuilder.BuildTalkEntityById(4, "key_4");

            _expectedResponse = new List <TalkEntity> {
                _expectedTalk1, _expectedTalk2, _expectedTalk3, _expectedTalk4
            };
        }
Beispiel #5
0
 public static TalkModel ToModel(this TalkEntity talkEntity)
 {
     return(new TalkModel
     {
         TalkId = talkEntity.Id,
         Title = talkEntity.Title,
         Abstract = talkEntity.Description,
         PresentationUrl = talkEntity.SlidesUrl,
         VideoUrl = talkEntity.VideoUrl,
         CodeUrl = talkEntity.CodeUrl,
         ShortTitle = talkEntity.Title,
         Speakers = SpeakerService.Speakers
                    .Where(s => talkEntity.SpeakerIds.Any(s1 => s1 == s.Id)).ToList(),
         MeetupModel = MeetupService.GetMeetup(talkEntity.Id)
     });
 }
Beispiel #6
0
        private TalkEntity CreateNewTalk(TalkCreationRequest request)
        {
            var defaultQuestionnaire = DefaultQuestionnaire.GetDefaultQuestionnaire();
            var questionnaireId      = _dbRepository.InsertQuestionnaire(defaultQuestionnaire);

            var talkDTO = new TalkEntity
            {
                Name             = request.Name,
                EasyAccessKey    = request.EasyAccessKey,
                Topic            = request.Topic,
                Description      = request.Description,
                SpeakerName      = request.SpeakerName,
                TalkCreationTime = DateTime.Now,
                TalkStartTime    = request.TalkStartTime,
                QuestionnaireId  = questionnaireId
            };

            return(talkDTO);
        }
        public void Setup()
        {
            _db                = A.Fake <IDapper>();
            _dbRepository      = new Repository(_db);
            _expectedStartTime = DateTime.Now.AddDays(7);

            _talksController = new TalksController(_dbRepository);

            _expectedTalk = TalkEntityBuilder.BuildTalkEntityById(_talkId, _easyAccessKey);

            _request = new TalkCreationRequest
            {
                Name          = "Test Talk",
                EasyAccessKey = "12345",
                Topic         = "Development",
                Description   = "This is only a test talk!",
                SpeakerName   = "Test Speaker Name",
                TalkStartTime = _expectedStartTime
            };
        }
Beispiel #8
0
        private static IEnumerable <Uri> GetMissingSpeakers(AuditXmlUpdate auditXmlUpdate, TalkEntity talk)
        {
            var existingSpeakers = talk.SpeakerIds.ExceptBy(auditXmlUpdate.Speakers.Select(speaker => speaker.Id), x => x);

            var speakerUrls = existingSpeakers.Select(speaker =>
                                                      new Uri($"https://raw.githubusercontent.com/DotNetRu/Audit/master/db/speakers/{speaker}/index.xml"));

            return(speakerUrls);
        }