Ejemplo n.º 1
0
        public async Task EvaluatedCallForSpeechByIdShouldBeSuccess()
        {
            CreateCategoriesAsync();
            CreateJudgeAsync();

            CallForSpeechSubmitDoer callForSpeechSubmitDoer =
                new CallForSpeechSubmitDoer(_geekLemonContex, _mapper);

            var cfs = GivenCallForSpeech().WithCategory
                          (c => c.WithId(1))
                      .Evaluated().Build();

            var status = await callForSpeechSubmitDoer.Run(cfs);

            CallForSpeechSaveEvaluatationDoer callForSpeechSaveEvaluatationDoer =
                new CallForSpeechSaveEvaluatationDoer(_geekLemonContex, _mapper);

            JudgeId judgeId = new JudgeId(1);

            var status2 = await callForSpeechSaveEvaluatationDoer.Run
                              (cfs.Id, cfs.ScoreResult, cfs.Status);

            status2.Success.Should().BeTrue();

            CallForSpeechGetByIdDoer callForSpeechGetByIdDoer =
                new CallForSpeechGetByIdDoer(_geekLemonContex, _mapper);

            var status3 = await callForSpeechGetByIdDoer.Run
                              (status.Value.CreatedId as CallForSpeechId);

            status3.Success.Should().BeTrue();

            status3.Value.Should().NotBeSameAs(cfs);
        }
Ejemplo n.º 2
0
        public async Task PreliminaryAcceptenceCallForSpeechByUniqueIdShouldBeSuccess()
        {
            CreateCategoriesAsync();
            CreateJudgeAsync();

            CallForSpeechSubmitDoer callForSpeechSubmitDoer =
                new CallForSpeechSubmitDoer(_geekLemonContex, _mapper);

            var cfs = GivenCallForSpeech().WithCategory
                          (c => c.WithId(1))
                      .Build();

            var status = await callForSpeechSubmitDoer.Run(cfs);

            CallForSpeechSavePreliminaryAcceptenceDoer callForSpeechSavePreliminaryAcceptenceDoer =
                new CallForSpeechSavePreliminaryAcceptenceDoer(_geekLemonContex, _mapper);

            JudgeId judgeId = new JudgeId(1);

            var status2 = await callForSpeechSavePreliminaryAcceptenceDoer.Run(cfs.UniqueId, judgeId,
                                                                               Domain.ValueObjects.CallForSpeechStatus.AcceptedByJudge);

            status2.Success.Should().BeTrue();

            CallForSpeechGetByIdDoer callForSpeechGetByIdDoer =
                new CallForSpeechGetByIdDoer(_geekLemonContex, _mapper);

            var status3 = await callForSpeechGetByIdDoer.Run
                              (status.Value.UniqueId as CallForSpeechUniqueId);

            status3.Success.Should().BeTrue();

            status3.Value.Should().NotBeSameAs(cfs);
        }