Exemple #1
0
        public async Task Then_the_expected_account_is_returned_if_it_exists()
        {
            // Arrange
            const string legalEntityId = "XYZ123__";
            var          testAccounts  = _fixture.CreateMany <Models.Account>(4).ToList();

            testAccounts.First().HashedLegalEntityId = legalEntityId;
            testAccounts.Last().HashedLegalEntityId  = legalEntityId;

            _dbContext.AddRange(testAccounts);
            _dbContext.SaveChanges();

            // Act
            var accounts = await _sut.GetByHashedLegalEntityId(legalEntityId);

            // Assert
            accounts.Should().BeEquivalentTo(testAccounts.Where(x => x.HashedLegalEntityId == legalEntityId),
                                             opt => opt.ExcludingMissingMembers());
        }