示例#1
0
        public async Task QueryAsync_WhenCalled_AssertGetClientSecretIdentitiesAsyncWasCalledOnSecurityRepository()
        {
            QueryHandler sut = CreateSut();

            await sut.QueryAsync(new EmptyQuery());

            _securityRepositoryMock.Verify(m => m.GetClientSecretIdentitiesAsync(), Times.Once);
        }
示例#2
0
        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));
        }
示例#3
0
        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"));
        }