public void AsAnonymous_ShouldReturnUnauthorizedAccessException() { var query = new GetDokumentQuery(); FluentActions.Invoking(() => SendAsync(query)).Should().Throw <UnauthorizedAccessException>(); }
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>(); }
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()); }