public async Task QueryAsync_WhenCalled_AssertGetClientSecretIdentitiesAsyncWasCalledOnSecurityRepository() { QueryHandler sut = CreateSut(); await sut.QueryAsync(new EmptyQuery()); _securityRepositoryMock.Verify(m => m.GetClientSecretIdentitiesAsync(), Times.Once); }
public async Task QueryAsync_WhenCalled_ReturnsClientSecretIdentitiesFromSecurityRepository() { IEnumerable <IClientSecretIdentity> clientSecretIdentityCollection = _fixture.CreateMany <IClientSecretIdentity>(_random.Next(5, 10)).ToList(); QueryHandler sut = CreateSut(clientSecretIdentityCollection); IEnumerable <IClientSecretIdentity> result = await sut.QueryAsync(new EmptyQuery()); Assert.That(result, Is.EqualTo(clientSecretIdentityCollection)); }
public void QueryAsync_WhenQueryIsNull_ThrowsArgumentNullException() { QueryHandler sut = CreateSut(); ArgumentNullException result = Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.QueryAsync(null)); Assert.That(result.ParamName, Is.EqualTo("query")); }