Ejemplo n.º 1
0
 public async Task WhenDoesNotExist_ThrowNotFoundException()
 {
     var request = new GetApartmentQuery()
     {
         Id = -1
     };
     await Assert
     .ThrowsAsync <NotFoundException>(async() => await this.sut.Handle(request, CancellationToken.None).ConfigureAwait(false))
     .ConfigureAwait(false);
 }
Ejemplo n.º 2
0
        public async Task WhenExists_ReturnsApartmentWithRequestedId()
        {
            var request = new GetApartmentQuery()
            {
                Id = this.dbApartment.Id
            };

            var result = await this.sut.Handle(request, CancellationToken.None).ConfigureAwait(false);

            Assert.NotNull(result);
            Assert.Equal(this.dbApartment.Id, result.Id);
        }