public async Task ContactAccountsAsync_WhenCalled_ReturnsOkObjectResultWhereValueIsContactAccountCollectionModelContainingAllContactAccounts() { IList <IContactAccount> contactAccounts = _fixture.CreateMany <IContactAccount>(_random.Next(5, 10)).ToList(); IContactAccountCollection contactAccountCollection = _fixture.BuildContactAccountCollectionMock(contactAccountCollection: contactAccounts).Object; Controller sut = CreateSut(contactAccountCollection); OkObjectResult result = (OkObjectResult)(await sut.ContactAccountsAsync(_fixture.Create <int>())).Result; ContactAccountCollectionModel contactAccountCollectionModel = (ContactAccountCollectionModel)result.Value; Assert.That(contactAccountCollectionModel, Is.Not.Null); Assert.That(contactAccountCollectionModel.Count, Is.EqualTo(contactAccounts.Count)); Assert.That(contactAccountCollectionModel.All(contactAccountModel => contactAccounts.SingleOrDefault(contactAccount => string.CompareOrdinal(contactAccountModel.AccountNumber, contactAccount.AccountNumber) == 0) != null), Is.True); }