Example #1
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQuery()
        {
            IExportContactCollectionQuery sut = CreateSut();

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result, Is.TypeOf <GetContactCollectionQuery>());
        }
Example #2
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsNotNull()
        {
            IExportContactCollectionQuery sut = CreateSut();

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result, Is.Not.Null);
        }
Example #3
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQueryWithExpiresFromExportContactCollectionQuery()
        {
            DateTime expires = DateTime.Now.AddSeconds(_random.Next(60, 100));
            IExportContactCollectionQuery sut = CreateSut(expires: expires);

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result.Expires, Is.EqualTo(expires));
        }
Example #4
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQueryWithRefreshTokenFromExportContactCollectionQuery()
        {
            string refreshToken = _fixture.Create <string>();
            IExportContactCollectionQuery sut = CreateSut(refreshToken: refreshToken);

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result.RefreshToken, Is.EqualTo(refreshToken));
        }
Example #5
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQueryWithTokenTypeFromExportContactCollectionQuery()
        {
            string tokenType = _fixture.Create <string>();
            IExportContactCollectionQuery sut = CreateSut(tokenType);

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result.TokenType, Is.EqualTo(tokenType));
        }
Example #6
0
        public async Task QueryAsync_WhenCalled_AssertQueryAsyncWasCalledOnGetContactCollectionQueryHandler()
        {
            QueryHandler sut = CreateSut();

            IGetContactCollectionQuery    getContactCollectionQuery = CreateGetContactCollectionQuery();
            IExportContactCollectionQuery query = CreateExportContactCollectionQuery(getContactCollectionQuery);
            await sut.QueryAsync(query);

            _getContactCollectionQueryHandlerMock.Verify(m => m.QueryAsync(It.Is <IGetContactCollectionQuery>(value => value != null && value == getContactCollectionQuery)), Times.Once);
        }