コード例 #1
0
        public void AsAnonymous_ShouldReturnUnauthorizedAccessException()
        {
            var query = new GetDokumentQuery();

            FluentActions.Invoking(() =>
                                   SendAsync(query)).Should().Throw <UnauthorizedAccessException>();
        }
コード例 #2
0
        public async Task AsAdmin_UnexistingDokument_ShouldReturnNotFoundException()
        {
            var user = RunAsVermittlerUser();

            await CreateVermittlerMitDokument();

            var query = new GetDokumentQuery()
            {
                DokumentId = -1
            };

            user.IstVermittler.Should().BeTrue();

            FluentActions.Invoking(() =>
                                   SendAsync(query)).Should().Throw <NotFoundException>();
        }
コード例 #3
0
        public async Task AsVermittler_ShouldReturnVermittlerDokumentDto()
        {
            var vermittler = await CreateVermittlerMitDokument();

            var user = RunAsPassedInVermittler(vermittler);

            var query = new GetDokumentQuery()
            {
                DokumentId = 1
            };

            var result = await SendAsync(query);

            user.IstVermittler.Should().BeTrue();
            result.GetType().Should().Be <RegistrierungsDokumentDto>();
            result.DokuemntenArtId.Should().Be(1);
            result.FileExtension.Should().Be(FileExtension.pdf.ToString());
        }