public async Task GetPrimaryAddress_UserDoesNotExist_ShouldThrowNotFoundException() { var sut = new GetPrimaryAddressQueryHandler(_fixture.Context); await sut.Handle(new GetPrimaryAddressQuery { UserId = Guid.NewGuid() }, CancellationToken.None) .ShouldThrowAsync <NotFoundException>(); }
public async Task GetPrimaryAddress_NoAddressForUser_ShouldThrowNotFoundException() { var sut = new GetPrimaryAddressQueryHandler(_fixture.Context); await sut.Handle(new GetPrimaryAddressQuery { UserId = _fixture.UserWithNoAddress.Id }, CancellationToken.None).ShouldThrowAsync <NotFoundException>(); }
public async Task GetPrimaryAddress_WhenCalled_ShouldReturnPrimaryAddress() { var sut = new GetPrimaryAddressQueryHandler(_fixture.Context); var result = await sut.Handle(new GetPrimaryAddressQuery { UserId = _fixture.CurrentUser.Id }, CancellationToken.None); result.PrimaryAddress.ShouldBe(true); }